From 55f8709b136e8e6283fad4215454909bb8b8d974 Mon Sep 17 00:00:00 2001 From: David Biesack Date: Tue, 14 Jan 2020 16:33:00 -0500 Subject: [PATCH 01/15] Fix typescript generator for parameter collectonFormat for pipes ssv --- .../main/java/org/openapitools/codegen/DefaultCodegen.java | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 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 d157cb808e0b..6d10a548ae06 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 @@ -4829,9 +4829,9 @@ protected String getCollectionFormat(Parameter parameter) { } else if (Parameter.StyleEnum.SIMPLE.equals(parameter.getStyle())) { return "csv"; } else if (Parameter.StyleEnum.PIPEDELIMITED.equals(parameter.getStyle())) { - return "pipe"; + return "pipes"; } else if (Parameter.StyleEnum.SPACEDELIMITED.equals(parameter.getStyle())) { - return "space"; + return "ssv"; } else { return null; } diff --git a/pom.xml b/pom.xml index 5ff033ed37a8..6b9777ed9c22 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,4 @@ - + org.sonatype.oss oss-parent From 77c05bf07ad10e161cd74413b7b6a74fc5b99786 Mon Sep 17 00:00:00 2001 From: David Biesack Date: Fri, 24 Jan 2020 11:25:00 -0500 Subject: [PATCH 02/15] Remove extra whitespace at beginning of file --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6b9777ed9c22..5ff033ed37a8 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,4 @@ - + org.sonatype.oss oss-parent From a111577139e55010a28c5c255456db9e51e52e3d Mon Sep 17 00:00:00 2001 From: David Biesack Date: Wed, 5 Feb 2020 08:56:57 -0500 Subject: [PATCH 03/15] merge master, revert extra space in pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d107fc7e89ef..29c6a6767d61 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,4 @@ - + org.sonatype.oss oss-parent From f3d4007624efd21220f83bdc2a1e53eeccab8e81 Mon Sep 17 00:00:00 2001 From: David Biesack Date: Wed, 5 Feb 2020 08:59:38 -0500 Subject: [PATCH 04/15] remove leading space in pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d107fc7e89ef..29c6a6767d61 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,4 @@ - + org.sonatype.oss oss-parent From df2fe572a855d5c8b488a88f961e795e275eab02 Mon Sep 17 00:00:00 2001 From: David Biesack Date: Fri, 20 Mar 2020 12:05:10 -0400 Subject: [PATCH 05/15] regenerated samples --- .../petstore/ada/.openapi-generator/VERSION | 2 +- .../src/client/samples-petstore-clients.adb | 2 +- .../src/client/samples-petstore-clients.ads | 2 +- .../ada/src/model/samples-petstore-models.adb | 2 +- .../ada/src/model/samples-petstore-models.ads | 2 +- .../httpclient/.openapi-generator/VERSION | 2 +- .../petstore/android/httpclient/README.md | 10 +- .../petstore/android/httpclient/build.gradle | 2 +- .../android/httpclient/docs/ApiResponse.md | 3 + .../android/httpclient/docs/Category.md | 3 + .../petstore/android/httpclient/docs/Order.md | 5 +- .../petstore/android/httpclient/docs/Pet.md | 5 +- .../android/httpclient/docs/PetApi.md | 104 +- .../android/httpclient/docs/StoreApi.md | 52 +- .../petstore/android/httpclient/docs/Tag.md | 3 + .../petstore/android/httpclient/docs/User.md | 3 + .../android/httpclient/docs/UserApi.md | 120 +- .../petstore/android/httpclient/git_push.sh | 14 +- .../org/openapitools/client/ApiException.java | 2 +- .../org/openapitools/client/ApiInvoker.java | 2 +- .../org/openapitools/client/HttpPatch.java | 2 +- .../java/org/openapitools/client/Pair.java | 2 +- .../org/openapitools/client/api/PetApi.java | 26 +- .../org/openapitools/client/api/StoreApi.java | 14 +- .../org/openapitools/client/api/UserApi.java | 50 +- .../android/volley/.openapi-generator/VERSION | 2 +- .../client/petstore/android/volley/README.md | 10 +- .../petstore/android/volley/build.gradle | 2 +- .../android/volley/docs/ApiResponse.md | 3 + .../petstore/android/volley/docs/Category.md | 3 + .../petstore/android/volley/docs/Order.md | 5 +- .../petstore/android/volley/docs/Pet.md | 5 +- .../petstore/android/volley/docs/PetApi.md | 104 +- .../petstore/android/volley/docs/StoreApi.md | 52 +- .../petstore/android/volley/docs/Tag.md | 3 + .../petstore/android/volley/docs/User.md | 3 + .../petstore/android/volley/docs/UserApi.md | 120 +- .../petstore/android/volley/git_push.sh | 15 +- .../client/petstore/android/volley/pom.xml | 6 + .../org/openapitools/client/ApiException.java | 2 +- .../org/openapitools/client/ApiInvoker.java | 2 +- .../org/openapitools/client/JsonUtil.java | 2 +- .../java/org/openapitools/client/Pair.java | 2 +- .../org/openapitools/client/api/PetApi.java | 58 +- .../org/openapitools/client/api/StoreApi.java | 30 +- .../org/openapitools/client/api/UserApi.java | 114 +- .../openapitools/client/auth/ApiKeyAuth.java | 2 +- .../client/auth/Authentication.java | 2 +- .../client/auth/HttpBasicAuth.java | 2 +- .../client/model/ApiResponse.java | 2 +- .../openapitools/client/model/Category.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 2 +- .../org/openapitools/client/model/Tag.java | 2 +- .../org/openapitools/client/model/User.java | 2 +- .../client/request/DeleteRequest.java | 2 +- .../client/request/GetRequest.java | 2 +- .../client/request/PatchRequest.java | 2 +- .../client/request/PostRequest.java | 2 +- .../client/request/PutRequest.java | 2 +- .../petstore/bash/.openapi-generator/VERSION | 2 +- samples/client/petstore/bash/Dockerfile | 1 - samples/client/petstore/bash/README.md | 40 +- samples/client/petstore/bash/_petstore-cli | 16 +- .../bash/docs/AdditionalPropertiesClass.md | 13 +- .../petstore/bash/docs/AnotherFakeApi.md | 2 +- samples/client/petstore/bash/docs/EnumTest.md | 3 - samples/client/petstore/bash/docs/FakeApi.md | 63 +- .../bash/docs/FakeClassnameTags123Api.md | 2 +- .../client/petstore/bash/docs/FormatTest.md | 3 +- samples/client/petstore/bash/docs/PetApi.md | 4 +- samples/client/petstore/bash/docs/StoreApi.md | 4 +- samples/client/petstore/bash/docs/UserApi.md | 16 +- samples/client/petstore/bash/petstore-cli | 361 ++--- .../bash/petstore-cli.bash-completion | 6 +- .../clojure/.openapi-generator/VERSION | 2 +- samples/client/petstore/clojure/git_push.sh | 16 +- .../clojure/src/open_api_petstore/api/pet.clj | 8 +- .../src/open_api_petstore/api/store.clj | 4 +- .../src/open_api_petstore/api/user.clj | 16 +- .../cpp-tizen/.openapi-generator/VERSION | 2 +- .../petstore/cpp-tizen/src/PetManager.cpp | 28 +- .../petstore/cpp-tizen/src/PetManager.h | 16 +- .../petstore/cpp-tizen/src/StoreManager.cpp | 14 +- .../petstore/cpp-tizen/src/StoreManager.h | 8 +- .../petstore/cpp-tizen/src/UserManager.cpp | 64 +- .../petstore/cpp-tizen/src/UserManager.h | 32 +- .../OpenAPIClient/.openapi-generator/VERSION | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../.openapi-generator/VERSION | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 2 +- .../.openapi-generator/VERSION | 2 +- .../OpenAPIClientNetCoreProject/README.md | 4 +- .../docs/FakeApi.md | 8 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 28 +- .../src/Org.OpenAPITools/Client/ApiClient.cs | 2 + .../src/Org.OpenAPITools/Model/Animal.cs | 1 + .../.openapi-generator/VERSION | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../.openapi-generator/VERSION | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../dart-dio/.openapi-generator/VERSION | 2 +- .../eiffel/.openapi-generator/VERSION | 2 +- samples/client/petstore/eiffel/README.md | 25 +- samples/client/petstore/eiffel/api_client.ecf | 2 +- .../docs/ADDITIONAL_PROPERTIES_CLASS.md | 13 +- .../petstore/eiffel/docs/ANOTHERFAKE_API.md | 10 +- .../client/petstore/eiffel/docs/CATEGORY.md | 2 +- .../eiffel/docs/FAKECLASSNAMETAGS123_API.md | 4 +- .../client/petstore/eiffel/docs/FAKE_API.md | 171 ++- .../petstore/eiffel/docs/FORMAT_TEST.md | 3 +- .../eiffel/docs/HAS_ONLY_READ_ONLY.md | 4 +- .../client/petstore/eiffel/docs/MAP_TEST.md | 2 + samples/client/petstore/eiffel/docs/NAME.md | 4 +- .../client/petstore/eiffel/docs/PET_API.md | 53 +- .../petstore/eiffel/docs/READ_ONLY_FIRST.md | 2 +- .../client/petstore/eiffel/docs/STORE_API.md | 8 +- .../client/petstore/eiffel/docs/USER_API.md | 26 +- .../eiffel/src/api/another_fake_api.e | 10 +- .../client/petstore/eiffel/src/api/fake_api.e | 195 ++- .../src/api/fake_classname_tags123_api.e | 8 +- .../client/petstore/eiffel/src/api/pet_api.e | 62 +- .../petstore/eiffel/src/api/store_api.e | 8 +- .../client/petstore/eiffel/src/api/user_api.e | 26 +- .../client/petstore/eiffel/src/api_client.e | 2 +- .../src/domain/additional_properties_class.e | 211 ++- .../petstore/eiffel/src/domain/animal.e | 2 +- .../petstore/eiffel/src/domain/api_response.e | 2 +- .../domain/array_of_array_of_number_only.e | 2 +- .../eiffel/src/domain/array_of_number_only.e | 2 +- .../petstore/eiffel/src/domain/array_test.e | 2 +- .../eiffel/src/domain/capitalization.e | 2 +- .../client/petstore/eiffel/src/domain/cat.e | 2 +- .../petstore/eiffel/src/domain/category.e | 2 +- .../petstore/eiffel/src/domain/class_model.e | 2 +- .../petstore/eiffel/src/domain/client.e | 2 +- .../client/petstore/eiffel/src/domain/dog.e | 2 +- .../petstore/eiffel/src/domain/enum_arrays.e | 2 +- .../petstore/eiffel/src/domain/enum_class.e | 2 +- .../petstore/eiffel/src/domain/enum_test.e | 2 +- .../petstore/eiffel/src/domain/format_test.e | 19 +- .../eiffel/src/domain/has_only_read_only.e | 2 +- .../petstore/eiffel/src/domain/map_test.e | 46 +- ...operties_and_additional_properties_class.e | 2 +- .../eiffel/src/domain/model_200_response.e | 2 +- .../client/petstore/eiffel/src/domain/name.e | 2 +- .../petstore/eiffel/src/domain/number_only.e | 2 +- .../client/petstore/eiffel/src/domain/order.e | 2 +- .../eiffel/src/domain/outer_composite.e | 2 +- .../petstore/eiffel/src/domain/outer_enum.e | 2 +- .../client/petstore/eiffel/src/domain/pet.e | 2 +- .../eiffel/src/domain/read_only_first.e | 2 +- .../petstore/eiffel/src/domain/return.e | 2 +- .../eiffel/src/domain/special_model_name.e | 2 +- .../client/petstore/eiffel/src/domain/tag.e | 2 +- .../client/petstore/eiffel/src/domain/user.e | 2 +- .../eiffel/src/framework/api_client_request.e | 2 +- .../src/framework/api_client_response.e | 2 +- .../petstore/eiffel/src/framework/api_error.e | 2 +- .../petstore/eiffel/src/framework/api_i.e | 2 +- .../eiffel/src/framework/auth/api_key_auth.e | 2 +- .../src/framework/auth/authentication.e | 2 +- .../src/framework/auth/http_basic_auth.e | 2 +- .../eiffel/src/framework/auth/oauth.e | 2 +- .../eiffel/src/framework/configuration.e | 2 +- .../serialization/api_deserializer.e | 2 +- .../serialization/api_json_deserializer.e | 4 +- .../serialization/api_json_serializer.e | 2 +- .../framework/serialization/api_serializer.e | 2 +- .../client/petstore/eiffel/test/api_test.ecf | 2 +- .../erlang-client/.openapi-generator/VERSION | 2 +- .../erlang-client/src/petstore_pet_api.erl | 16 +- .../erlang-client/src/petstore_store_api.erl | 8 +- .../erlang-client/src/petstore_user_api.erl | 32 +- .../erlang-proper/.openapi-generator/VERSION | 2 +- .../erlang-proper/src/petstore_api.erl | 16 +- .../erlang-proper/src/petstore_statem.erl | 16 +- .../petstore/flash/.openapi-generator/VERSION | 2 +- samples/client/petstore/flash/flash/build.xml | 6 +- .../src/org/openapitools/client/api/PetApi.as | 8 +- .../org/openapitools/client/api/StoreApi.as | 4 +- .../org/openapitools/client/api/UserApi.as | 16 +- .../org/openapitools/event/ApiClientEvent.as | 4 +- samples/client/petstore/flash/git_push.sh | 16 +- .../go-experimental/go-petstore/api_fake.go | 2 +- .../go/go-petstore-withXml/api_fake.go | 2 +- .../petstore/go/go-petstore/api_fake.go | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../openapitools/client/api/FakeApiImpl.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../API/Client/PetApi.js | 31 +- .../API/Client/StoreApi.js | 12 +- .../API/Client/UserApi.js | 48 +- .../javascript-es6/src/api/FakeApi.js | 2 +- .../petstore/javascript-flowtyped/.babelrc | 2 +- .../.openapi-generator/VERSION | 2 +- .../javascript-promise-es6/src/api/FakeApi.js | 2 +- .../javascript-promise/src/api/FakeApi.js | 2 +- .../petstore/javascript/src/api/FakeApi.js | 2 +- .../.openapi-generator/VERSION | 2 +- .../java/org/openapitools/model/Order.java | 6 +- .../gen/java/org/openapitools/model/Pet.java | 8 +- .../jmeter/.openapi-generator/VERSION | 2 +- samples/client/petstore/jmeter/PetApi.csv | 2 +- samples/client/petstore/jmeter/StoreApi.csv | 2 +- samples/client/petstore/jmeter/UserApi.csv | 2 +- .../.openapi-generator/VERSION | 2 +- .../kotlin-uppercase-enum/build.gradle | 4 +- .../org/openapitools/client/apis/EnumApi.kt | 4 +- .../client/infrastructure/ApiClient.kt | 86 +- .../ApiInfrastructureResponse.kt | 5 +- .../client/infrastructure/Errors.kt | 4 +- .../org/openapitools/client/models/PetEnum.kt | 9 + .../petstore/lua/.openapi-generator/VERSION | 2 +- samples/client/petstore/lua/git_push.sh | 14 +- .../petstore/lua/petstore/api/pet_api.lua | 10 +- .../petstore/lua/petstore/api/store_api.lua | 6 +- .../petstore/lua/petstore/api/user_api.lua | 18 +- .../lua/petstore/model/api_response.lua | 2 +- .../petstore/lua/petstore/model/category.lua | 2 +- .../petstore/lua/petstore/model/order.lua | 2 +- .../petstore/lua/petstore/model/pet.lua | 2 +- .../petstore/lua/petstore/model/tag.lua | 2 +- .../petstore/lua/petstore/model/user.lua | 2 +- .../objc/core-data/.openapi-generator/VERSION | 2 +- .../client/petstore/objc/core-data/README.md | 4 +- .../core-data/SwaggerClient/Api/SWGPetApi.h | 10 +- .../core-data/SwaggerClient/Api/SWGPetApi.m | 16 +- .../core-data/SwaggerClient/Api/SWGStoreApi.h | 6 +- .../core-data/SwaggerClient/Api/SWGStoreApi.m | 6 +- .../core-data/SwaggerClient/Api/SWGUserApi.h | 18 +- .../core-data/SwaggerClient/Api/SWGUserApi.m | 24 +- .../Core/JSONValueTransformer+ISO8601.h | 2 +- .../core-data/SwaggerClient/Core/SWGApi.h | 2 +- .../SwaggerClient/Core/SWGApiClient.h | 2 +- .../SwaggerClient/Core/SWGConfiguration.h | 2 +- .../Core/SWGDefaultConfiguration.h | 4 +- .../Core/SWGJSONRequestSerializer.h | 2 +- .../core-data/SwaggerClient/Core/SWGLogger.h | 2 +- .../core-data/SwaggerClient/Core/SWGObject.h | 2 +- .../Core/SWGQueryParamCollection.h | 2 +- .../Core/SWGResponseDeserializer.h | 4 +- .../SwaggerClient/Core/SWGSanitizer.h | 2 +- .../SwaggerClient/Model/SWGCategory.h | 2 +- .../Model/SWGCategoryManagedObject.h | 2 +- .../Model/SWGCategoryManagedObjectBuilder.h | 2 +- .../core-data/SwaggerClient/Model/SWGOrder.h | 2 +- .../Model/SWGOrderManagedObject.h | 2 +- .../Model/SWGOrderManagedObjectBuilder.h | 2 +- .../core-data/SwaggerClient/Model/SWGPet.h | 2 +- .../SwaggerClient/Model/SWGPetManagedObject.h | 2 +- .../Model/SWGPetManagedObjectBuilder.h | 2 +- .../core-data/SwaggerClient/Model/SWGTag.h | 2 +- .../SwaggerClient/Model/SWGTagManagedObject.h | 2 +- .../Model/SWGTagManagedObjectBuilder.h | 2 +- .../core-data/SwaggerClient/Model/SWGUser.h | 2 +- .../Model/SWGUserManagedObject.h | 2 +- .../Model/SWGUserManagedObjectBuilder.h | 2 +- .../petstore/objc/core-data/git_push.sh | 16 +- .../objc/default/.openapi-generator/VERSION | 2 +- .../client/petstore/objc/default/README.md | 4 +- .../default/SwaggerClient/Api/SWGPetApi.h | 10 +- .../default/SwaggerClient/Api/SWGPetApi.m | 16 +- .../default/SwaggerClient/Api/SWGStoreApi.h | 6 +- .../default/SwaggerClient/Api/SWGStoreApi.m | 6 +- .../default/SwaggerClient/Api/SWGUserApi.h | 18 +- .../default/SwaggerClient/Api/SWGUserApi.m | 24 +- .../Core/JSONValueTransformer+ISO8601.h | 2 +- .../objc/default/SwaggerClient/Core/SWGApi.h | 2 +- .../default/SwaggerClient/Core/SWGApiClient.h | 2 +- .../SwaggerClient/Core/SWGConfiguration.h | 2 +- .../Core/SWGDefaultConfiguration.h | 4 +- .../Core/SWGJSONRequestSerializer.h | 2 +- .../default/SwaggerClient/Core/SWGLogger.h | 2 +- .../default/SwaggerClient/Core/SWGObject.h | 2 +- .../Core/SWGQueryParamCollection.h | 2 +- .../Core/SWGResponseDeserializer.h | 4 +- .../default/SwaggerClient/Core/SWGSanitizer.h | 2 +- .../default/SwaggerClient/Model/SWGCategory.h | 2 +- .../default/SwaggerClient/Model/SWGOrder.h | 2 +- .../objc/default/SwaggerClient/Model/SWGPet.h | 2 +- .../objc/default/SwaggerClient/Model/SWGTag.h | 2 +- .../default/SwaggerClient/Model/SWGUser.h | 2 +- .../petstore/objc/default/docs/SWGPetApi.md | 16 +- .../petstore/objc/default/docs/SWGStoreApi.md | 8 +- .../petstore/objc/default/docs/SWGUserApi.md | 32 +- .../client/petstore/objc/default/git_push.sh | 16 +- .../petstore/ocaml/.openapi-generator/VERSION | 2 +- .../powershell/.openapi-generator/VERSION | 2 +- .../petstore_api/api/fake_api.py | 2 +- .../petstore_api/api/fake_api.py | 2 +- .../python/petstore_api/api/fake_api.py | 2 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_api.rb | 2 +- .../.openapi-generator/VERSION | 2 +- .../hyper/petstore/.openapi-generator/VERSION | 2 +- .../rust-test/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/.openapi-generator/VERSION | 2 +- .../rust-test/.openapi-generator/VERSION | 2 +- .../client/api/DateTimeCodecs.scala | 3 + .../swift/default/.openapi-generator/VERSION | 2 +- .../Classes/OpenAPIs/APIHelper.swift | 12 +- .../Classes/OpenAPIs/APIs.swift | 27 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 136 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 78 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 134 +- .../OpenAPIs/AlamofireImplementations.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 6 +- .../Classes/OpenAPIs/Models.swift | 40 +- .../Classes/OpenAPIs/Models/Category.swift | 5 +- .../Classes/OpenAPIs/Models/Order.swift | 7 +- .../Classes/OpenAPIs/Models/Pet.swift | 7 +- .../Classes/OpenAPIs/Models/Tag.swift | 5 +- .../Classes/OpenAPIs/Models/User.swift | 5 +- .../client/petstore/swift/default/git_push.sh | 16 +- .../promisekit/.openapi-generator/VERSION | 2 +- .../Classes/OpenAPIs/APIHelper.swift | 12 +- .../Classes/OpenAPIs/APIs.swift | 27 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 140 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 86 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 152 +- .../OpenAPIs/AlamofireImplementations.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 6 +- .../Classes/OpenAPIs/Models.swift | 40 +- .../Classes/OpenAPIs/Models/Category.swift | 5 +- .../Classes/OpenAPIs/Models/Order.swift | 7 +- .../Classes/OpenAPIs/Models/Pet.swift | 7 +- .../Classes/OpenAPIs/Models/Tag.swift | 5 +- .../Classes/OpenAPIs/Models/User.swift | 5 +- .../petstore/swift/promisekit/git_push.sh | 16 +- .../swift/rxswift/.openapi-generator/VERSION | 2 +- .../Classes/OpenAPIs/APIHelper.swift | 12 +- .../Classes/OpenAPIs/APIs.swift | 27 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 140 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 84 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 152 +- .../OpenAPIs/AlamofireImplementations.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 6 +- .../Classes/OpenAPIs/Models.swift | 40 +- .../Classes/OpenAPIs/Models/Category.swift | 5 +- .../Classes/OpenAPIs/Models/Order.swift | 7 +- .../Classes/OpenAPIs/Models/Pet.swift | 7 +- .../Classes/OpenAPIs/Models/Tag.swift | 5 +- .../Classes/OpenAPIs/Models/User.swift | 5 +- .../client/petstore/swift/rxswift/git_push.sh | 16 +- .../swift3/default/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 14 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 206 ++- .../APIs/FakeClassnameTags123API.swift | 12 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 70 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 12 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 52 +- .../Classes/OpenAPIs/Models.swift | 200 ++- .../Models/AdditionalPropertiesClass.swift | 8 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 7 + .../Classes/OpenAPIs/Models/MapTest.swift | 4 + .../petstore/swift3/default/git_push.sh | 14 +- .../objcCompatible/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 14 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 206 ++- .../APIs/FakeClassnameTags123API.swift | 12 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 70 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 12 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 52 +- .../Classes/OpenAPIs/Models.swift | 200 ++- .../Models/AdditionalPropertiesClass.swift | 8 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 7 + .../Classes/OpenAPIs/Models/FormatTest.swift | 5 - .../Classes/OpenAPIs/Models/MapTest.swift | 4 + .../Classes/OpenAPIs/Models/NumberOnly.swift | 5 - .../OpenAPIs/Models/OuterComposite.swift | 5 - .../swift3/objcCompatible/git_push.sh | 14 +- .../promisekit/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 20 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 294 +++- .../APIs/FakeClassnameTags123API.swift | 18 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 100 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 18 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 78 +- .../Classes/OpenAPIs/Models.swift | 200 ++- .../Models/AdditionalPropertiesClass.swift | 8 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 7 + .../Classes/OpenAPIs/Models/MapTest.swift | 4 + .../petstore/swift3/promisekit/git_push.sh | 14 +- .../swift3/rxswift/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 20 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 302 +++- .../APIs/FakeClassnameTags123API.swift | 18 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 102 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 18 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 78 +- .../Classes/OpenAPIs/Models.swift | 200 ++- .../Models/AdditionalPropertiesClass.swift | 8 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 7 + .../Classes/OpenAPIs/Models/MapTest.swift | 4 + .../petstore/swift3/rxswift/git_push.sh | 14 +- .../unwraprequired/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 14 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 206 ++- .../APIs/FakeClassnameTags123API.swift | 12 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 70 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 12 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 52 +- .../Classes/OpenAPIs/Models.swift | 200 ++- .../Models/AdditionalPropertiesClass.swift | 14 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 10 +- .../Classes/OpenAPIs/Models/MapTest.swift | 8 +- .../swift3/unwraprequired/git_push.sh | 14 +- .../petstore/swift4/default/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 70 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 56 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 28 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 48 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift4/nonPublicApi/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 70 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 56 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 28 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 48 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift4/objcCompatible/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 6 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 72 +- .../APIs/FakeClassnameTags123API.swift | 6 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 58 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 30 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 50 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 6 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 6 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 6 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 6 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 4 +- .../Classes/OpenAPIs/Models/Name.swift | 4 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 6 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 6 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 4 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 6 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 6 +- .../swift4/promisekitLibrary/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 + .../Classes/OpenAPIs/APIs/FakeAPI.swift | 58 +- .../APIs/FakeClassnameTags123API.swift | 2 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 46 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 24 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 36 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift4/resultLibrary/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 86 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 64 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 32 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 60 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift4/rxswiftLibrary/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 + .../Classes/OpenAPIs/APIs/FakeAPI.swift | 48 +- .../APIs/FakeClassnameTags123API.swift | 2 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 38 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 22 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 32 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift4/unwrapRequired/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 70 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 56 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 28 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 48 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift5/alamofireLibrary/Package.swift | 8 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 56 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 48 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 26 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 36 +- .../OpenAPIs/AlamofireImplementations.swift | 55 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift5/combineLibrary/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 + .../Classes/OpenAPIs/APIs/FakeAPI.swift | 34 +- .../APIs/FakeClassnameTags123API.swift | 2 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 30 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 22 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 20 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../petstore/swift5/default/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 56 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 48 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 26 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 36 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/nonPublicApi/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 56 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 48 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 26 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 36 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/objcCompatible/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 6 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 58 +- .../APIs/FakeClassnameTags123API.swift | 6 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 50 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 28 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 38 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 6 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 6 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 6 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 6 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 4 +- .../Classes/OpenAPIs/Models/Name.swift | 4 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 6 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 6 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 4 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 6 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/promisekitLibrary/Package.swift | 8 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 + .../Classes/OpenAPIs/APIs/FakeAPI.swift | 44 +- .../APIs/FakeClassnameTags123API.swift | 2 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 38 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 22 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 24 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/resultLibrary/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 + .../Classes/OpenAPIs/APIs/FakeAPI.swift | 34 +- .../APIs/FakeClassnameTags123API.swift | 2 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 30 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 20 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 20 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/rxswiftLibrary/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 + .../Classes/OpenAPIs/APIs/FakeAPI.swift | 34 +- .../APIs/FakeClassnameTags123API.swift | 2 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 30 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 20 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 20 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/urlsessionLibrary/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 56 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 48 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 26 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 36 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../client/test/swift4/default/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../TestClient/Classes/OpenAPIs/APIs.swift | 14 +- .../Classes/OpenAPIs/APIs/Swift4TestAPI.swift | 8 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../TestClient/Classes/OpenAPIs/Models.swift | 4 +- .../OpenAPIs/Models/AllPrimitives.swift | 3 +- .../Classes/OpenAPIs/Models/BaseCard.swift | 3 +- .../Classes/OpenAPIs/Models/ErrorInfo.swift | 3 +- .../OpenAPIs/Models/GetAllModelsResult.swift | 3 +- ...ModelWithIntAdditionalPropertiesOnly.swift | 7 +- ...ithPropertiesAndAdditionalProperties.swift | 6 +- ...elWithStringAdditionalPropertiesOnly.swift | 7 +- .../Classes/OpenAPIs/Models/PersonCard.swift | 3 +- .../OpenAPIs/Models/PersonCardAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/PlaceCard.swift | 3 +- .../OpenAPIs/Models/PlaceCardAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/SampleBase.swift | 3 +- .../OpenAPIs/Models/SampleSubClass.swift | 3 +- .../OpenAPIs/Models/SampleSubClassAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/StringEnum.swift | 1 + .../OpenAPIs/Models/VariableNameTest.swift | 5 +- .../swift4/default/docs/SampleSubClass.md | 2 - .../client/test/swift5/default/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../TestClient/Classes/OpenAPIs/APIs.swift | 14 +- .../Classes/OpenAPIs/APIs/Swift5TestAPI.swift | 8 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../TestClient/Classes/OpenAPIs/Models.swift | 7 +- .../OpenAPIs/Models/AllPrimitives.swift | 3 +- .../Classes/OpenAPIs/Models/BaseCard.swift | 3 +- .../Classes/OpenAPIs/Models/ErrorInfo.swift | 3 +- .../OpenAPIs/Models/GetAllModelsResult.swift | 3 +- ...ModelWithIntAdditionalPropertiesOnly.swift | 7 +- ...ithPropertiesAndAdditionalProperties.swift | 6 +- ...elWithStringAdditionalPropertiesOnly.swift | 7 +- .../Classes/OpenAPIs/Models/PersonCard.swift | 3 +- .../OpenAPIs/Models/PersonCardAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/PlaceCard.swift | 3 +- .../OpenAPIs/Models/PlaceCardAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/SampleBase.swift | 3 +- .../OpenAPIs/Models/SampleSubClass.swift | 3 +- .../OpenAPIs/Models/SampleSubClassAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/StringEnum.swift | 1 + .../OpenAPIs/Models/VariableNameTest.swift | 5 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/default/docs/SampleSubClass.md | 2 - .../apache2/.openapi-generator/VERSION | 2 +- samples/config/petstore/apache2/PetApi.conf | 10 +- samples/config/petstore/apache2/StoreApi.conf | 6 +- samples/config/petstore/apache2/UserApi.conf | 12 +- .../graphql-schema/.openapi-generator/VERSION | 2 +- .../petstore/api/pet_api.graphql | 2 +- .../petstore/api/store_api.graphql | 2 +- .../petstore/api/user_api.graphql | 2 +- .../petstore/model/api_response.graphql | 2 +- .../petstore/model/category.graphql | 2 +- .../petstore/model/order.graphql | 2 +- .../graphql-schema/petstore/model/pet.graphql | 2 +- .../graphql-schema/petstore/model/tag.graphql | 2 +- .../petstore/model/user.graphql | 2 +- .../.openapi-generator/VERSION | 2 +- .../asciidoc/.openapi-generator/VERSION | 2 +- .../cwiki/.openapi-generator/VERSION | 2 +- .../documentation/cwiki/confluence-markup.txt | 1338 ++++++++-------- .../dynamic-html/.openapi-generator/VERSION | 2 +- .../dynamic-html/docs/operations/PetApi.html | 4 +- .../docs/operations/StoreApi.html | 2 +- .../dynamic-html/docs/operations/UserApi.html | 12 +- .../html.md/.openapi-generator/VERSION | 2 +- samples/documentation/html.md/index.html | 10 +- .../html/.openapi-generator/VERSION | 2 +- samples/documentation/html/index.html | 14 +- .../html2/.openapi-generator/VERSION | 2 +- samples/documentation/html2/index.html | 438 +++--- .../markdown/.openapi-generator/VERSION | 2 +- .../documentation/markdown/Apis/StoreApi.md | 8 +- .../documentation/markdown/Apis/UserApi.md | 12 +- .../aspnetcore/.openapi-generator/VERSION | 2 +- .../cpp-restbed/.openapi-generator/VERSION | 2 +- .../petstore/cpp-restbed/api/PetApi.cpp | 18 +- .../server/petstore/cpp-restbed/api/PetApi.h | 18 +- .../petstore/cpp-restbed/api/StoreApi.cpp | 10 +- .../petstore/cpp-restbed/api/StoreApi.h | 6 +- .../petstore/cpp-restbed/api/UserApi.cpp | 18 +- .../server/petstore/cpp-restbed/api/UserApi.h | 14 +- .../cpp-restbed/model/ApiResponse.cpp | 2 +- .../petstore/cpp-restbed/model/ApiResponse.h | 2 +- .../petstore/cpp-restbed/model/Category.cpp | 2 +- .../petstore/cpp-restbed/model/Category.h | 2 +- .../petstore/cpp-restbed/model/Order.cpp | 2 +- .../server/petstore/cpp-restbed/model/Order.h | 2 +- .../server/petstore/cpp-restbed/model/Pet.cpp | 13 +- .../server/petstore/cpp-restbed/model/Pet.h | 2 +- .../server/petstore/cpp-restbed/model/Tag.cpp | 2 +- .../server/petstore/cpp-restbed/model/Tag.h | 2 +- .../petstore/cpp-restbed/model/User.cpp | 2 +- .../server/petstore/cpp-restbed/model/User.h | 2 +- .../.openapi-generator/VERSION | 2 +- .../fsharp-giraffe/.openapi-generator/VERSION | 2 +- .../OpenAPI/src/api/PetApiHandler.fs | 4 + .../OpenAPI/src/api/PetApiHandlerParams.fs | 14 +- .../OpenAPI/src/impl/PetApiService.fs | 7 + .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java-inflector/.openapi-generator/VERSION | 2 +- .../model/AdditionalPropertiesClass.java | 245 ++- .../java/org/openapitools/model/Animal.java | 2 +- .../openapitools/model/Capitalization.java | 12 +- .../gen/java/org/openapitools/model/Cat.java | 3 +- .../java/org/openapitools/model/Category.java | 6 +- .../org/openapitools/model/ClassModel.java | 2 +- .../java/org/openapitools/model/Client.java | 2 +- .../gen/java/org/openapitools/model/Dog.java | 3 +- .../org/openapitools/model/EnumArrays.java | 6 +- .../org/openapitools/model/EnumClass.java | 2 +- .../java/org/openapitools/model/EnumTest.java | 18 +- .../model/FileSchemaTestClass.java | 2 +- .../org/openapitools/model/FormatTest.java | 54 +- .../openapitools/model/HasOnlyReadOnly.java | 4 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../openapitools/model/Model200Response.java | 4 +- .../openapitools/model/ModelApiResponse.java | 6 +- .../org/openapitools/model/ModelReturn.java | 2 +- .../gen/java/org/openapitools/model/Name.java | 8 +- .../org/openapitools/model/NumberOnly.java | 2 +- .../java/org/openapitools/model/Order.java | 12 +- .../openapitools/model/OuterComposite.java | 6 +- .../org/openapitools/model/OuterEnum.java | 2 +- .../gen/java/org/openapitools/model/Pet.java | 10 +- .../org/openapitools/model/ReadOnlyFirst.java | 4 +- .../openapitools/model/SpecialModelName.java | 2 +- .../gen/java/org/openapitools/model/Tag.java | 4 +- .../gen/java/org/openapitools/model/User.java | 16 +- .../controllers/AnotherFakeController.java | 2 +- .../FakeClassnameTestController.java | 2 +- .../controllers/FakeController.java | 29 +- .../controllers/PetController.java | 4 +- .../controllers/StoreController.java | 2 +- .../controllers/UserController.java | 8 +- .../src/main/openapi/openapi.yaml | 1297 +++++++++++----- .../java-pkmst/.openapi-generator/VERSION | 2 +- .../com/prokarma/pkmst/controller/PetApi.java | 2 +- .../prokarma/pkmst/controller/StoreApi.java | 2 +- .../prokarma/pkmst/controller/UserApi.java | 2 +- .../app/controllers/FakeApiController.java | 2 +- .../java-undertow/.openapi-generator/VERSION | 2 +- .../main/java/org/openapitools/model/Pet.java | 2 +- .../src/main/resources/config/openapi.json | 760 ++++----- .../rx/.openapi-generator/VERSION | 2 +- .../vertxweb/server/api/PetApi.java | 4 +- .../vertxweb/server/api/PetApiImpl.java | 4 +- .../vertxweb/server/model/Category.java | 2 +- .../vertxweb/server/model/InlineObject.java | 2 +- .../vertxweb/server/model/InlineObject1.java | 2 +- .../server/model/ModelApiResponse.java | 2 +- .../vertxweb/server/model/Order.java | 2 +- .../vertxweb/server/model/Pet.java | 2 +- .../vertxweb/server/model/Tag.java | 2 +- .../vertxweb/server/model/User.java | 2 +- .../rx/src/main/resources/openapi.yaml | 80 +- .../async/.openapi-generator/VERSION | 2 +- .../java-vertx/rx/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java/org/openapitools/api/FakeApi.java | 17 +- .../model/AdditionalPropertiesAnyType.java | 1 + .../model/AdditionalPropertiesArray.java | 1 + .../model/AdditionalPropertiesBoolean.java | 1 + .../model/AdditionalPropertiesClass.java | 7 +- .../model/AdditionalPropertiesInteger.java | 1 + .../model/AdditionalPropertiesNumber.java | 1 + .../model/AdditionalPropertiesObject.java | 1 + .../model/AdditionalPropertiesString.java | 1 + .../java/org/openapitools/model/Animal.java | 2 + .../org/openapitools/model/AnimalFarm.java | 1 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../openapitools/model/ArrayOfNumberOnly.java | 1 + .../org/openapitools/model/ArrayTest.java | 1 + .../openapitools/model/Capitalization.java | 1 + .../gen/java/org/openapitools/model/Cat.java | 2 + .../java/org/openapitools/model/Category.java | 1 + .../org/openapitools/model/ClassModel.java | 1 + .../java/org/openapitools/model/Client.java | 1 + .../gen/java/org/openapitools/model/Dog.java | 2 + .../org/openapitools/model/EnumArrays.java | 1 + .../java/org/openapitools/model/EnumTest.java | 1 + .../model/FileSchemaTestClass.java | 3 +- .../org/openapitools/model/FormatTest.java | 29 + .../openapitools/model/HasOnlyReadOnly.java | 1 + .../java/org/openapitools/model/MapTest.java | 1 + ...ropertiesAndAdditionalPropertiesClass.java | 1 + .../openapitools/model/Model200Response.java | 1 + .../openapitools/model/ModelApiResponse.java | 1 + .../org/openapitools/model/ModelReturn.java | 1 + .../gen/java/org/openapitools/model/Name.java | 1 + .../org/openapitools/model/NumberOnly.java | 1 + .../java/org/openapitools/model/Order.java | 1 + .../openapitools/model/OuterComposite.java | 1 + .../gen/java/org/openapitools/model/Pet.java | 3 +- .../org/openapitools/model/ReadOnlyFirst.java | 1 + .../openapitools/model/SpecialModelName.java | 1 + .../openapitools/model/StringBooleanMap.java | 1 + .../gen/java/org/openapitools/model/Tag.java | 1 + .../openapitools/model/TypeHolderDefault.java | 1 + .../openapitools/model/TypeHolderExample.java | 30 + .../gen/java/org/openapitools/model/User.java | 1 + .../java/org/openapitools/model/XmlItem.java | 1 + .../api/impl/AnotherFakeApiServiceImpl.java | 2 +- .../api/impl/FakeApiServiceImpl.java | 11 +- .../FakeClassnameTags123ApiServiceImpl.java | 2 +- .../api/impl/PetApiServiceImpl.java | 2 +- .../api/impl/StoreApiServiceImpl.java | 2 +- .../api/impl/UserApiServiceImpl.java | 2 +- .../src/main/resources/test-data.json | 9 +- .../test-data-control.json | 17 + .../.openapi-generator/VERSION | 2 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 36 +- .../api/FakeClassnameTestApi.java | 2 +- .../gen/java/org/openapitools/api/PetApi.java | 13 +- .../java/org/openapitools/api/StoreApi.java | 2 +- .../java/org/openapitools/api/UserApi.java | 8 +- .../model/AdditionalPropertiesClass.java | 223 ++- .../java/org/openapitools/model/Animal.java | 10 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../openapitools/model/Capitalization.java | 12 +- .../gen/java/org/openapitools/model/Cat.java | 6 +- .../java/org/openapitools/model/Category.java | 9 +- .../org/openapitools/model/ClassModel.java | 3 +- .../java/org/openapitools/model/Client.java | 2 +- .../gen/java/org/openapitools/model/Dog.java | 6 +- .../org/openapitools/model/EnumArrays.java | 16 +- .../org/openapitools/model/EnumClass.java | 6 +- .../java/org/openapitools/model/EnumTest.java | 36 +- .../model/FileSchemaTestClass.java | 6 +- .../org/openapitools/model/FormatTest.java | 50 +- .../openapitools/model/HasOnlyReadOnly.java | 4 +- .../java/org/openapitools/model/MapTest.java | 23 +- ...ropertiesAndAdditionalPropertiesClass.java | 6 +- .../openapitools/model/Model200Response.java | 5 +- .../openapitools/model/ModelApiResponse.java | 6 +- .../org/openapitools/model/ModelReturn.java | 3 +- .../gen/java/org/openapitools/model/Name.java | 9 +- .../org/openapitools/model/NumberOnly.java | 2 +- .../java/org/openapitools/model/Order.java | 18 +- .../openapitools/model/OuterComposite.java | 6 +- .../org/openapitools/model/OuterEnum.java | 6 +- .../gen/java/org/openapitools/model/Pet.java | 20 +- .../org/openapitools/model/ReadOnlyFirst.java | 4 +- .../openapitools/model/SpecialModelName.java | 2 +- .../gen/java/org/openapitools/model/Tag.java | 4 +- .../gen/java/org/openapitools/model/User.java | 16 +- .../src/main/openapi/openapi.yaml | 1353 ++++++++++++----- .../.openapi-generator/VERSION | 2 +- .../build.gradle.kts | 6 +- .../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 +- .../kotlin/vertx/.openapi-generator/VERSION | 2 +- .../org/openapitools/server/api/model/Pet.kt | 4 +- .../nancyfx-async/.openapi-generator/VERSION | 2 +- .../nancyfx/.openapi-generator/VERSION | 2 +- .../Org.OpenAPITools/Models/ApiResponse.cs | 2 +- .../src/Org.OpenAPITools/Models/Category.cs | 2 +- .../src/Org.OpenAPITools/Models/Order.cs | 10 +- .../src/Org.OpenAPITools/Models/Pet.cs | 2 +- .../src/Org.OpenAPITools/Models/Tag.cs | 2 +- .../src/Org.OpenAPITools/Models/User.cs | 2 +- .../src/Org.OpenAPITools/Modules/PetModule.cs | 38 +- .../Org.OpenAPITools/Modules/StoreModule.cs | 22 +- .../Org.OpenAPITools/Modules/UserModule.cs | 70 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../Utils/LocalDateConverter.cs | 2 +- .../src/Org.OpenAPITools/Utils/Parameters.cs | 2 +- .../.openapi-generator/VERSION | 2 +- .../nodejs-express-server/api/openapi.yaml | 62 +- .../php-laravel/.openapi-generator/VERSION | 2 +- .../app/Http/Controllers/FakeController.php | 46 +- .../php-laravel/lib/app/Models/FormatTest.php | 3 + .../lib/app/Models/TypeHolderExample.php | 3 + .../petstore/php-laravel/lib/routes/api.php | 11 +- .../.openapi-generator-ignore | 23 - .../.openapi-generator/VERSION | 1 - .../petstore/python-blueplanet/README.md | 59 - .../python-blueplanet/requirements.txt | 2 - .../ruby-on-rails/.openapi-generator/VERSION | 2 +- .../ruby-on-rails/db/migrate/0_init_tables.rb | 14 - .../ruby-sinatra/.openapi-generator/VERSION | 2 +- .../server/petstore/ruby-sinatra/openapi.yaml | 256 ++-- .../org/openapitools/server/api/PetApi.scala | 12 +- .../openapitools/server/api/StoreApi.scala | 4 +- .../org/openapitools/server/api/UserApi.scala | 16 +- 1637 files changed, 15983 insertions(+), 9868 deletions(-) delete mode 100644 samples/server/petstore/python-blueplanet/.openapi-generator-ignore delete mode 100644 samples/server/petstore/python-blueplanet/.openapi-generator/VERSION delete mode 100644 samples/server/petstore/python-blueplanet/README.md delete mode 100644 samples/server/petstore/python-blueplanet/requirements.txt diff --git a/samples/client/petstore/ada/.openapi-generator/VERSION b/samples/client/petstore/ada/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/client/petstore/ada/.openapi-generator/VERSION +++ b/samples/client/petstore/ada/.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/client/petstore/ada/src/client/samples-petstore-clients.adb b/samples/client/petstore/ada/src/client/samples-petstore-clients.adb index 1920cbf1fe40..add37b0b16d7 100644 --- a/samples/client/petstore/ada/src/client/samples-petstore-clients.adb +++ b/samples/client/petstore/ada/src/client/samples-petstore-clients.adb @@ -4,7 +4,7 @@ -- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.2.3-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. diff --git a/samples/client/petstore/ada/src/client/samples-petstore-clients.ads b/samples/client/petstore/ada/src/client/samples-petstore-clients.ads index adc6a3c692ab..6bf3f7c8b878 100644 --- a/samples/client/petstore/ada/src/client/samples-petstore-clients.ads +++ b/samples/client/petstore/ada/src/client/samples-petstore-clients.ads @@ -4,7 +4,7 @@ -- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.2.3-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. diff --git a/samples/client/petstore/ada/src/model/samples-petstore-models.adb b/samples/client/petstore/ada/src/model/samples-petstore-models.adb index db3f9463478e..b4bcabf6d4d6 100644 --- a/samples/client/petstore/ada/src/model/samples-petstore-models.adb +++ b/samples/client/petstore/ada/src/model/samples-petstore-models.adb @@ -4,7 +4,7 @@ -- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.2.3-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. diff --git a/samples/client/petstore/ada/src/model/samples-petstore-models.ads b/samples/client/petstore/ada/src/model/samples-petstore-models.ads index 4b0e867aa076..d27afd7bcdae 100644 --- a/samples/client/petstore/ada/src/model/samples-petstore-models.ads +++ b/samples/client/petstore/ada/src/model/samples-petstore-models.ads @@ -4,7 +4,7 @@ -- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.2.3-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. diff --git a/samples/client/petstore/android/httpclient/.openapi-generator/VERSION b/samples/client/petstore/android/httpclient/.openapi-generator/VERSION index afa636560641..bfbf77eb7fad 100644 --- a/samples/client/petstore/android/httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/android/httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/android/httpclient/README.md b/samples/client/petstore/android/httpclient/README.md index 309ba5d78118..325ce22b90c8 100644 --- a/samples/client/petstore/android/httpclient/README.md +++ b/samples/client/petstore/android/httpclient/README.md @@ -49,8 +49,8 @@ At first generate the JAR by executing: Then manually install the following JARs: -* target/openapi-android-client-1.0.0.jar -* target/lib/*.jar +- target/openapi-android-client-1.0.0.jar +- target/lib/*.jar ## Getting Started @@ -64,9 +64,9 @@ public class PetApiExample { public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -120,11 +120,13 @@ Authentication schemes defined for the API: ### api_key - **Type**: API key + - **API key parameter name**: api_key - **Location**: HTTP header ### petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/android/httpclient/build.gradle b/samples/client/petstore/android/httpclient/build.gradle index 6be898ef01d9..7e9fd7b30bef 100644 --- a/samples/client/petstore/android/httpclient/build.gradle +++ b/samples/client/petstore/android/httpclient/build.gradle @@ -3,7 +3,7 @@ project.version = '1.0.0' buildscript { repositories { - mavenCentral() + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/android/httpclient/docs/ApiResponse.md b/samples/client/petstore/android/httpclient/docs/ApiResponse.md index 1c17767c2b72..a169bf232e15 100644 --- a/samples/client/petstore/android/httpclient/docs/ApiResponse.md +++ b/samples/client/petstore/android/httpclient/docs/ApiResponse.md @@ -1,7 +1,9 @@ + # ApiResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **Integer** | | [optional] @@ -10,3 +12,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/httpclient/docs/Category.md b/samples/client/petstore/android/httpclient/docs/Category.md index e2df08032787..53c9fedc8bc4 100644 --- a/samples/client/petstore/android/httpclient/docs/Category.md +++ b/samples/client/petstore/android/httpclient/docs/Category.md @@ -1,7 +1,9 @@ + # Category ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/httpclient/docs/Order.md b/samples/client/petstore/android/httpclient/docs/Order.md index 5746ce97fad3..f49e8704e088 100644 --- a/samples/client/petstore/android/httpclient/docs/Order.md +++ b/samples/client/petstore/android/httpclient/docs/Order.md @@ -1,7 +1,9 @@ + # Order ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/httpclient/docs/Pet.md b/samples/client/petstore/android/httpclient/docs/Pet.md index a4daa24feb60..72e3338dfb83 100644 --- a/samples/client/petstore/android/httpclient/docs/Pet.md +++ b/samples/client/petstore/android/httpclient/docs/Pet.md @@ -1,7 +1,9 @@ + # Pet ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/httpclient/docs/PetApi.md b/samples/client/petstore/android/httpclient/docs/PetApi.md index 7cf076f29c58..4f91f08bc476 100644 --- a/samples/client/petstore/android/httpclient/docs/PetApi.md +++ b/samples/client/petstore/android/httpclient/docs/PetApi.md @@ -14,21 +14,23 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - -# **addPet** -> addPet(pet) + +## addPet + +> addPet(body) Add a new pet to the store ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -37,9 +39,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -51,16 +54,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## deletePet - -# **deletePet** > deletePet(petId, apiKey) Deletes a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -78,6 +83,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| Pet id to delete | [default to null] @@ -93,11 +99,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## findPetsByStatus - -# **findPetsByStatus** > List<Pet> findPetsByStatus(status) Finds Pets by status @@ -105,6 +112,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -122,6 +130,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] @@ -136,11 +145,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## findPetsByTags - -# **findPetsByTags** > List<Pet> findPetsByTags(tags) Finds Pets by tags @@ -148,6 +158,7 @@ Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -165,6 +176,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to null] @@ -179,11 +191,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## getPetById - -# **getPetById** > Pet getPetById(petId) Find pet by ID @@ -191,6 +204,7 @@ Find pet by ID Returns a single pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -208,6 +222,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to return | [default to null] @@ -222,24 +237,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json - -# **updatePet** -> updatePet(pet) + +## updatePet + +> updatePet(body) Update an existing pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -248,9 +265,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -262,16 +280,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## updatePetWithForm - -# **updatePetWithForm** > updatePetWithForm(petId, name, status) Updates a pet in the store with form data ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -290,6 +310,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet that needs to be updated | [default to null] @@ -306,16 +327,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +## uploadFile - -# **uploadFile** > ApiResponse uploadFile(petId, additionalMetadata, file) uploads an image ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -335,6 +358,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | [default to null] @@ -351,6 +375,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json diff --git a/samples/client/petstore/android/httpclient/docs/StoreApi.md b/samples/client/petstore/android/httpclient/docs/StoreApi.md index b768ad5ba986..d2229bfd71f4 100644 --- a/samples/client/petstore/android/httpclient/docs/StoreApi.md +++ b/samples/client/petstore/android/httpclient/docs/StoreApi.md @@ -10,8 +10,9 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - -# **deleteOrder** + +## deleteOrder + > deleteOrder(orderId) Delete purchase order by ID @@ -19,6 +20,7 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -35,6 +37,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **String**| ID of the order that needs to be deleted | [default to null] @@ -49,11 +52,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getInventory - -# **getInventory** > Map<String, Integer> getInventory() Returns pet inventories by status @@ -61,6 +65,7 @@ Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -76,6 +81,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -88,11 +94,12 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + + +## getOrderById - -# **getOrderById** > Order getOrderById(orderId) Find purchase order by ID @@ -100,6 +107,7 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -117,6 +125,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **Long**| ID of pet that needs to be fetched | [default to null] @@ -131,24 +140,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json - -# **placeOrder** -> Order placeOrder(order) + +## placeOrder + +> Order placeOrder(body) Place an order for a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; StoreApi apiInstance = new StoreApi(); -Order order = new Order(); // Order | order placed for purchasing the pet +Order body = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -158,9 +169,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -172,6 +184,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json diff --git a/samples/client/petstore/android/httpclient/docs/Tag.md b/samples/client/petstore/android/httpclient/docs/Tag.md index de6814b55d57..b540cab453f0 100644 --- a/samples/client/petstore/android/httpclient/docs/Tag.md +++ b/samples/client/petstore/android/httpclient/docs/Tag.md @@ -1,7 +1,9 @@ + # Tag ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/httpclient/docs/User.md b/samples/client/petstore/android/httpclient/docs/User.md index 8b6753dd284a..5e51c05150c8 100644 --- a/samples/client/petstore/android/httpclient/docs/User.md +++ b/samples/client/petstore/android/httpclient/docs/User.md @@ -1,7 +1,9 @@ + # User ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -15,3 +17,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/httpclient/docs/UserApi.md b/samples/client/petstore/android/httpclient/docs/UserApi.md index e5a16428112e..4c54ee4c77c6 100644 --- a/samples/client/petstore/android/httpclient/docs/UserApi.md +++ b/samples/client/petstore/android/httpclient/docs/UserApi.md @@ -14,23 +14,25 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - -# **createUser** -> createUser(user) + +## createUser + +> createUser(body) Create user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -User user = new User(); // User | Created user object +User body = new User(); // User | Created user object try { - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -39,9 +41,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -53,24 +56,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(user) + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List body = Arrays.asList(new User()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -79,9 +84,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -93,24 +99,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **createUsersWithListInput** -> createUsersWithListInput(user) + +## createUsersWithListInput + +> createUsersWithListInput(body) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List body = Arrays.asList(new User()); // List | List of user object try { - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -119,9 +127,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -133,11 +142,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## deleteUser - -# **deleteUser** > deleteUser(username) Delete user @@ -145,6 +155,7 @@ Delete user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -161,6 +172,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be deleted | [default to null] @@ -175,16 +187,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getUserByName - -# **getUserByName** > User getUserByName(username) Get user by user name ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -202,6 +216,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] @@ -216,16 +231,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## loginUser - -# **loginUser** > String loginUser(username, password) Logs user into the system ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -244,6 +261,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The user name for login | [default to null] @@ -259,16 +277,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## logoutUser - -# **logoutUser** > logoutUser() Logs out current logged in user session ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -283,6 +303,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -295,27 +316,29 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **updateUser** -> updateUser(username, user) + +## updateUser + +> updateUser(username, body) Updated user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); String username = null; // String | name that need to be deleted -User user = new User(); // User | Updated user object +User body = new User(); // User | Updated user object try { - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -324,10 +347,11 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **user** | [**User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type @@ -339,6 +363,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined diff --git a/samples/client/petstore/android/httpclient/git_push.sh b/samples/client/petstore/android/httpclient/git_push.sh index 20057f67ade4..ced3be2b0c7b 100644 --- a/samples/client/petstore/android/httpclient/git_push.sh +++ b/samples/client/petstore/android/httpclient/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java index 7e9a6ef4d562..2e0db8b1bf70 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java index 18403b1972c6..fd1eba49be83 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java index 33fd7b63bd2a..5f6c62e79d8a 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java index 21a436455a1d..062883523107 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java index 10e4466ae0b2..361994a058f0 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,14 +53,14 @@ public String getBasePath() { /** * Add a new pet to the store * - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store * @return void */ - public void addPet (Pet pet) throws ApiException { - Object localVarPostBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); + public void addPet (Pet body) throws ApiException { + Object localVarPostBody = body; + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling addPet"); } // create path and map variables @@ -317,14 +317,14 @@ public Pet getPetById (Long petId) throws ApiException { /** * Update an existing pet * - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store * @return void */ - public void updatePet (Pet pet) throws ApiException { - Object localVarPostBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); + public void updatePet (Pet body) throws ApiException { + Object localVarPostBody = body; + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet"); } // create path and map variables diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java index 91dadd5646da..17ad5b2c0840 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -203,14 +203,14 @@ public Order getOrderById (Long orderId) throws ApiException { /** * Place an order for a pet * - * @param order order placed for purchasing the pet + * @param body order placed for purchasing the pet * @return Order */ - public Order placeOrder (Order order) throws ApiException { - Object localVarPostBody = order; - // verify the required parameter 'order' is set - if (order == null) { - throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); + public Order placeOrder (Order body) throws ApiException { + Object localVarPostBody = body; + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder"); } // create path and map variables diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java index 6189aff41a38..c6a854dec579 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,14 +52,14 @@ public String getBasePath() { /** * Create user * This can only be done by the logged in user. - * @param user Created user object + * @param body Created user object * @return void */ - public void createUser (User user) throws ApiException { - Object localVarPostBody = user; - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); + public void createUser (User body) throws ApiException { + Object localVarPostBody = body; + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createUser"); } // create path and map variables @@ -104,14 +104,14 @@ public void createUser (User user) throws ApiException { /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object * @return void */ - public void createUsersWithArrayInput (List user) throws ApiException { - Object localVarPostBody = user; - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); + public void createUsersWithArrayInput (List body) throws ApiException { + Object localVarPostBody = body; + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); } // create path and map variables @@ -156,14 +156,14 @@ public void createUsersWithArrayInput (List user) throws ApiException { /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object * @return void */ - public void createUsersWithListInput (List user) throws ApiException { - Object localVarPostBody = user; - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); + public void createUsersWithListInput (List body) throws ApiException { + Object localVarPostBody = body; + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"); } // create path and map variables @@ -419,18 +419,18 @@ public void logoutUser () throws ApiException { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param user Updated user object + * @param body Updated user object * @return void */ - public void updateUser (String username, User user) throws ApiException { - Object localVarPostBody = user; + public void updateUser (String username, User body) throws ApiException { + Object localVarPostBody = body; // verify the required parameter 'username' is set if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); } - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser"); } // create path and map variables diff --git a/samples/client/petstore/android/volley/.openapi-generator/VERSION b/samples/client/petstore/android/volley/.openapi-generator/VERSION index afa636560641..bfbf77eb7fad 100644 --- a/samples/client/petstore/android/volley/.openapi-generator/VERSION +++ b/samples/client/petstore/android/volley/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/android/volley/README.md b/samples/client/petstore/android/volley/README.md index c2fca9e2b9eb..d4f8c7a7f174 100644 --- a/samples/client/petstore/android/volley/README.md +++ b/samples/client/petstore/android/volley/README.md @@ -49,8 +49,8 @@ At first generate the JAR by executing: Then manually install the following JARs: -* target/petstore-android-volley-1.0.0.jar -* target/lib/*.jar +- target/petstore-android-volley-1.0.0.jar +- target/lib/*.jar ## Getting Started @@ -64,9 +64,9 @@ public class PetApiExample { public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -120,11 +120,13 @@ Authentication schemes defined for the API: ### api_key - **Type**: API key + - **API key parameter name**: api_key - **Location**: HTTP header ### petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/android/volley/build.gradle b/samples/client/petstore/android/volley/build.gradle index b3a4c135c03f..215e7832c483 100644 --- a/samples/client/petstore/android/volley/build.gradle +++ b/samples/client/petstore/android/volley/build.gradle @@ -3,7 +3,7 @@ project.version = '1.0.0' buildscript { repositories { - mavenCentral() + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/android/volley/docs/ApiResponse.md b/samples/client/petstore/android/volley/docs/ApiResponse.md index 1c17767c2b72..a169bf232e15 100644 --- a/samples/client/petstore/android/volley/docs/ApiResponse.md +++ b/samples/client/petstore/android/volley/docs/ApiResponse.md @@ -1,7 +1,9 @@ + # ApiResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **Integer** | | [optional] @@ -10,3 +12,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/Category.md b/samples/client/petstore/android/volley/docs/Category.md index e2df08032787..53c9fedc8bc4 100644 --- a/samples/client/petstore/android/volley/docs/Category.md +++ b/samples/client/petstore/android/volley/docs/Category.md @@ -1,7 +1,9 @@ + # Category ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/Order.md b/samples/client/petstore/android/volley/docs/Order.md index 5746ce97fad3..f49e8704e088 100644 --- a/samples/client/petstore/android/volley/docs/Order.md +++ b/samples/client/petstore/android/volley/docs/Order.md @@ -1,7 +1,9 @@ + # Order ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/volley/docs/Pet.md b/samples/client/petstore/android/volley/docs/Pet.md index a4daa24feb60..72e3338dfb83 100644 --- a/samples/client/petstore/android/volley/docs/Pet.md +++ b/samples/client/petstore/android/volley/docs/Pet.md @@ -1,7 +1,9 @@ + # Pet ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/volley/docs/PetApi.md b/samples/client/petstore/android/volley/docs/PetApi.md index 7cf076f29c58..4f91f08bc476 100644 --- a/samples/client/petstore/android/volley/docs/PetApi.md +++ b/samples/client/petstore/android/volley/docs/PetApi.md @@ -14,21 +14,23 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - -# **addPet** -> addPet(pet) + +## addPet + +> addPet(body) Add a new pet to the store ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -37,9 +39,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -51,16 +54,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## deletePet - -# **deletePet** > deletePet(petId, apiKey) Deletes a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -78,6 +83,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| Pet id to delete | [default to null] @@ -93,11 +99,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## findPetsByStatus - -# **findPetsByStatus** > List<Pet> findPetsByStatus(status) Finds Pets by status @@ -105,6 +112,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -122,6 +130,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] @@ -136,11 +145,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## findPetsByTags - -# **findPetsByTags** > List<Pet> findPetsByTags(tags) Finds Pets by tags @@ -148,6 +158,7 @@ Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -165,6 +176,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to null] @@ -179,11 +191,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## getPetById - -# **getPetById** > Pet getPetById(petId) Find pet by ID @@ -191,6 +204,7 @@ Find pet by ID Returns a single pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -208,6 +222,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to return | [default to null] @@ -222,24 +237,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json - -# **updatePet** -> updatePet(pet) + +## updatePet + +> updatePet(body) Update an existing pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -248,9 +265,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -262,16 +280,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## updatePetWithForm - -# **updatePetWithForm** > updatePetWithForm(petId, name, status) Updates a pet in the store with form data ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -290,6 +310,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet that needs to be updated | [default to null] @@ -306,16 +327,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +## uploadFile - -# **uploadFile** > ApiResponse uploadFile(petId, additionalMetadata, file) uploads an image ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -335,6 +358,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | [default to null] @@ -351,6 +375,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json diff --git a/samples/client/petstore/android/volley/docs/StoreApi.md b/samples/client/petstore/android/volley/docs/StoreApi.md index b768ad5ba986..d2229bfd71f4 100644 --- a/samples/client/petstore/android/volley/docs/StoreApi.md +++ b/samples/client/petstore/android/volley/docs/StoreApi.md @@ -10,8 +10,9 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - -# **deleteOrder** + +## deleteOrder + > deleteOrder(orderId) Delete purchase order by ID @@ -19,6 +20,7 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -35,6 +37,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **String**| ID of the order that needs to be deleted | [default to null] @@ -49,11 +52,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getInventory - -# **getInventory** > Map<String, Integer> getInventory() Returns pet inventories by status @@ -61,6 +65,7 @@ Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -76,6 +81,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -88,11 +94,12 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + + +## getOrderById - -# **getOrderById** > Order getOrderById(orderId) Find purchase order by ID @@ -100,6 +107,7 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -117,6 +125,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **Long**| ID of pet that needs to be fetched | [default to null] @@ -131,24 +140,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json - -# **placeOrder** -> Order placeOrder(order) + +## placeOrder + +> Order placeOrder(body) Place an order for a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; StoreApi apiInstance = new StoreApi(); -Order order = new Order(); // Order | order placed for purchasing the pet +Order body = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -158,9 +169,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -172,6 +184,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json diff --git a/samples/client/petstore/android/volley/docs/Tag.md b/samples/client/petstore/android/volley/docs/Tag.md index de6814b55d57..b540cab453f0 100644 --- a/samples/client/petstore/android/volley/docs/Tag.md +++ b/samples/client/petstore/android/volley/docs/Tag.md @@ -1,7 +1,9 @@ + # Tag ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/User.md b/samples/client/petstore/android/volley/docs/User.md index 8b6753dd284a..5e51c05150c8 100644 --- a/samples/client/petstore/android/volley/docs/User.md +++ b/samples/client/petstore/android/volley/docs/User.md @@ -1,7 +1,9 @@ + # User ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -15,3 +17,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/UserApi.md b/samples/client/petstore/android/volley/docs/UserApi.md index e5a16428112e..4c54ee4c77c6 100644 --- a/samples/client/petstore/android/volley/docs/UserApi.md +++ b/samples/client/petstore/android/volley/docs/UserApi.md @@ -14,23 +14,25 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - -# **createUser** -> createUser(user) + +## createUser + +> createUser(body) Create user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -User user = new User(); // User | Created user object +User body = new User(); // User | Created user object try { - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -39,9 +41,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -53,24 +56,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(user) + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List body = Arrays.asList(new User()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -79,9 +84,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -93,24 +99,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **createUsersWithListInput** -> createUsersWithListInput(user) + +## createUsersWithListInput + +> createUsersWithListInput(body) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List body = Arrays.asList(new User()); // List | List of user object try { - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -119,9 +127,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -133,11 +142,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## deleteUser - -# **deleteUser** > deleteUser(username) Delete user @@ -145,6 +155,7 @@ Delete user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -161,6 +172,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be deleted | [default to null] @@ -175,16 +187,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getUserByName - -# **getUserByName** > User getUserByName(username) Get user by user name ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -202,6 +216,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] @@ -216,16 +231,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## loginUser - -# **loginUser** > String loginUser(username, password) Logs user into the system ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -244,6 +261,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The user name for login | [default to null] @@ -259,16 +277,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## logoutUser - -# **logoutUser** > logoutUser() Logs out current logged in user session ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -283,6 +303,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -295,27 +316,29 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **updateUser** -> updateUser(username, user) + +## updateUser + +> updateUser(username, body) Updated user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); String username = null; // String | name that need to be deleted -User user = new User(); // User | Updated user object +User body = new User(); // User | Updated user object try { - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -324,10 +347,11 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **user** | [**User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type @@ -339,6 +363,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined diff --git a/samples/client/petstore/android/volley/git_push.sh b/samples/client/petstore/android/volley/git_push.sh index 0f406ef78782..ced3be2b0c7b 100644 --- a/samples/client/petstore/android/volley/git_push.sh +++ b/samples/client/petstore/android/volley/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,5 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/android/volley/pom.xml b/samples/client/petstore/android/volley/pom.xml index 800d148e4df3..19765ff2968f 100644 --- a/samples/client/petstore/android/volley/pom.xml +++ b/samples/client/petstore/android/volley/pom.xml @@ -11,6 +11,12 @@ swagger-annotations ${swagger-annotations-version} + + + com.google.code.findbugs + jsr305 + 3.0.2 + org.apache.httpcomponents httpcore diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java index 70f3b77ceead..2f57c83eeb73 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java index 2e7ab447cf3d..9ff0422de5f9 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java index 3cdc69558e3d..c52b2dcd70d3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java index e8f34f395f89..d358fcf66b45 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java index f90cf9d21e36..a80910cd4c89 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -60,15 +60,15 @@ public String getBasePath() { /** * Add a new pet to the store * - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store * @return void */ - public void addPet (Pet pet) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling addPet", - new ApiException(400, "Missing the required parameter 'pet' when calling addPet")); + public void addPet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", + new ApiException(400, "Missing the required parameter 'body' when calling addPet")); } // create path and map variables @@ -124,15 +124,15 @@ public void addPet (Pet pet) throws TimeoutException, ExecutionException, Interr /** * Add a new pet to the store * - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store */ - public void addPet (Pet pet, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = pet; + public void addPet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'pet' is set - if (pet == null) { - VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling addPet", - new ApiException(400, "Missing the required parameter 'pet' when calling addPet")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", + new ApiException(400, "Missing the required parameter 'body' when calling addPet")); } // create path and map variables @@ -696,15 +696,15 @@ public void onErrorResponse(VolleyError error) { /** * Update an existing pet * - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store * @return void */ - public void updatePet (Pet pet) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling updatePet", - new ApiException(400, "Missing the required parameter 'pet' when calling updatePet")); + public void updatePet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", + new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); } // create path and map variables @@ -760,15 +760,15 @@ public void updatePet (Pet pet) throws TimeoutException, ExecutionException, Int /** * Update an existing pet * - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store */ - public void updatePet (Pet pet, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = pet; + public void updatePet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'pet' is set - if (pet == null) { - VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling updatePet", - new ApiException(400, "Missing the required parameter 'pet' when calling updatePet")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", + new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java index 3da1f3f76896..fd69b7573487 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -425,15 +425,15 @@ public void onErrorResponse(VolleyError error) { /** * Place an order for a pet * - * @param order order placed for purchasing the pet + * @param body order placed for purchasing the pet * @return Order */ - public Order placeOrder (Order order) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = order; - // verify the required parameter 'order' is set - if (order == null) { - VolleyError error = new VolleyError("Missing the required parameter 'order' when calling placeOrder", - new ApiException(400, "Missing the required parameter 'order' when calling placeOrder")); + public Order placeOrder (Order body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", + new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); } // create path and map variables @@ -487,15 +487,15 @@ public Order placeOrder (Order order) throws TimeoutException, ExecutionExceptio /** * Place an order for a pet * - * @param order order placed for purchasing the pet + * @param body order placed for purchasing the pet */ - public void placeOrder (Order order, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = order; + public void placeOrder (Order body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'order' is set - if (order == null) { - VolleyError error = new VolleyError("Missing the required parameter 'order' when calling placeOrder", - new ApiException(400, "Missing the required parameter 'order' when calling placeOrder")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", + new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java index ce88777ae1ca..edec8bce95e9 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -59,15 +59,15 @@ public String getBasePath() { /** * Create user * This can only be done by the logged in user. - * @param user Created user object + * @param body Created user object * @return void */ - public void createUser (User user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = user; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUser", - new ApiException(400, "Missing the required parameter 'user' when calling createUser")); + public void createUser (User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", + new ApiException(400, "Missing the required parameter 'body' when calling createUser")); } // create path and map variables @@ -121,15 +121,15 @@ public void createUser (User user) throws TimeoutException, ExecutionException, /** * Create user * This can only be done by the logged in user. - * @param user Created user object + * @param body Created user object */ - public void createUser (User user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = user; + public void createUser (User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUser", - new ApiException(400, "Missing the required parameter 'user' when calling createUser")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", + new ApiException(400, "Missing the required parameter 'body' when calling createUser")); } // create path and map variables @@ -182,15 +182,15 @@ public void onErrorResponse(VolleyError error) { /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object * @return void */ - public void createUsersWithArrayInput (List user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = user; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithArrayInput", - new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput")); + public void createUsersWithArrayInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); } // create path and map variables @@ -244,15 +244,15 @@ public void createUsersWithArrayInput (List user) throws TimeoutException, /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object */ - public void createUsersWithArrayInput (List user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = user; + public void createUsersWithArrayInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithArrayInput", - new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); } // create path and map variables @@ -305,15 +305,15 @@ public void onErrorResponse(VolleyError error) { /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object * @return void */ - public void createUsersWithListInput (List user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = user; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithListInput", - new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput")); + public void createUsersWithListInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); } // create path and map variables @@ -367,15 +367,15 @@ public void createUsersWithListInput (List user) throws TimeoutException, /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object */ - public void createUsersWithListInput (List user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = user; + public void createUsersWithListInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithListInput", - new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); } // create path and map variables @@ -933,20 +933,20 @@ public void onErrorResponse(VolleyError error) { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param user Updated user object + * @param body Updated user object * @return void */ - public void updateUser (String username, User user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = user; + public void updateUser (String username, User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; // verify the required parameter 'username' is set if (username == null) { VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); } - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling updateUser", - new ApiException(400, "Missing the required parameter 'user' when calling updateUser")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", + new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); } // create path and map variables @@ -1000,20 +1000,20 @@ public void updateUser (String username, User user) throws TimeoutException, Exe /** * Updated user * This can only be done by the logged in user. - * @param username name that need to be deleted * @param user Updated user object + * @param username name that need to be deleted * @param body Updated user object */ - public void updateUser (String username, User user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = user; + public void updateUser (String username, User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; // verify the required parameter 'username' is set if (username == null) { VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); } - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling updateUser", - new ApiException(400, "Missing the required parameter 'user' when calling updateUser")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", + new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index b15bbd4de9d6..fe6364d31729 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java index 7ea7f36402c6..2eec51b72b97 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 8b66fa172161..1226b62d5b2b 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java index 00254f1548aa..82d2c3031356 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java index cd1473811a1c..25016438a568 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java index 6d4ba799ea4f..b5958b2eb652 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java index 71026c8fdc40..b8fa5f5b48c3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java index dd37b76de2fb..c61264d3c9c3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java index 268f152e1d56..757cc8fed0a3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java index d4143bbe63d5..387e52f102c0 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java index 4c87ff45bd7b..dd2c824098c0 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java index 909c4ea18a07..4f97af9d06d9 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java index 229891e581d3..dd4c40ddc85d 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java index 70da15b48d96..877d4855c440 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/bash/.openapi-generator/VERSION b/samples/client/petstore/bash/.openapi-generator/VERSION index e4955748d3e7..bfbf77eb7fad 100644 --- a/samples/client/petstore/bash/.openapi-generator/VERSION +++ b/samples/client/petstore/bash/.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/client/petstore/bash/Dockerfile b/samples/client/petstore/bash/Dockerfile index 77df27f36614..ee17f324a5c9 100644 --- a/samples/client/petstore/bash/Dockerfile +++ b/samples/client/petstore/bash/Dockerfile @@ -41,7 +41,6 @@ $(tput setaf 3)PETSTORE_HOST$(tput sgr0) - server URL, e.g. https://example.com: $(tput setaf 3)PETSTORE_API_KEY$(tput sgr0) - access token, e.g. "ASDASHJDG63456asdASSD"\n\ $(tput setaf 3)PETSTORE_API_KEY$(tput sgr0) - access token, e.g. "ASDASHJDG63456asdASSD"\n\ $(tput setaf 3)PETSTORE_BASIC_AUTH$(tput sgr0) - basic authentication credentials, e.g.: "username:password"\n\ -$(tput setaf 3)PETSTORE_BASIC_AUTH$(tput sgr0) - basic authentication credentials, e.g.: "username:password"\n\ \n\ $(tput setaf 7)Basic usage:$(tput sgr0)\n\ \n\ diff --git a/samples/client/petstore/bash/README.md b/samples/client/petstore/bash/README.md index 8179fa5a2a91..242de1b51a09 100644 --- a/samples/client/petstore/bash/README.md +++ b/samples/client/petstore/bash/README.md @@ -101,8 +101,7 @@ All URIs are relative to */v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | -*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**createXmlItem**](docs/FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -111,9 +110,9 @@ Class | Method | HTTP request | Description *FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters -假端點 -偽のエンドポイント -가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -145,13 +144,23 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [$special[modelName]](docs/$special[modelName].md) - [200Response](docs/200Response.md) + - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) + - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) + - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) + - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) + - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) + - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Animal](docs/Animal.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [BigCat](docs/BigCat.md) + - [BigCatAllOf](docs/BigCatAllOf.md) - [Capitalization](docs/Capitalization.md) - [Cat](docs/Cat.md) - [CatAllOf](docs/CatAllOf.md) @@ -164,34 +173,23 @@ Class | Method | HTTP request | Description - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [Foo](docs/Foo.md) - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [HealthCheckResult](docs/HealthCheckResult.md) - - [InlineObject](docs/InlineObject.md) - - [InlineObject1](docs/InlineObject1.md) - - [InlineObject2](docs/InlineObject2.md) - - [InlineObject3](docs/InlineObject3.md) - - [InlineObject4](docs/InlineObject4.md) - - [InlineObject5](docs/InlineObject5.md) - - [InlineResponseDefault](docs/InlineResponseDefault.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Name](docs/Name.md) - - [NullableClass](docs/NullableClass.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) - - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) - - [OuterEnumInteger](docs/OuterEnumInteger.md) - - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Return](docs/Return.md) - - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TypeHolderDefault](docs/TypeHolderDefault.md) + - [TypeHolderExample](docs/TypeHolderExample.md) - [User](docs/User.md) + - [XmlItem](docs/XmlItem.md) ## Documentation For Authorization @@ -211,10 +209,6 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key_query - **Location**: URL query string -## bearer_test - -- **Type**: HTTP basic authentication - ## http_basic_test - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/bash/_petstore-cli b/samples/client/petstore/bash/_petstore-cli index 323b934de071..3a0073f2840c 100644 --- a/samples/client/petstore/bash/_petstore-cli +++ b/samples/client/petstore/bash/_petstore-cli @@ -296,7 +296,7 @@ case $state in ops) # Operations _values "Operations" \ - "call123TestSpecialTags[To test special tags]" "fooGet[]" "fakeHealthGet[Health check endpoint]" \ + "call123TestSpecialTags[To test special tags]" "createXmlItem[creates an XmlItem]" \ "fakeOuterBooleanSerialize[]" \ "fakeOuterCompositeSerialize[]" \ "fakeOuterNumberSerialize[]" \ @@ -305,9 +305,9 @@ case $state in "testBodyWithQueryParams[]" \ "testClientModel[To test \"client\" model]" \ "testEndpointParameters[Fake endpoint for testing various parameters -假端點 -偽のエンドポイント -가짜 엔드 포인트]" \ + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트]" \ "testEnumParameters[To test enum parameters]" \ "testGroupParameters[Fake endpoint to test group parameters (optional)]" \ "testInlineAdditionalProperties[test inline additionalProperties]" \ @@ -343,13 +343,7 @@ case $state in ) _describe -t actions 'operations' _op_arguments -S '' && ret=0 ;; - fooGet) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - fakeHealthGet) + createXmlItem) local -a _op_arguments _op_arguments=( ) diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md b/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md index 0b452819e9e1..5b1ed2dce633 100644 --- a/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md @@ -3,8 +3,17 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mapUnderscoreproperty** | **map[String, string]** | | [optional] [default to null] -**mapUnderscoreofUnderscoremapUnderscoreproperty** | **map[String, map[String, string]]** | | [optional] [default to null] +**mapUnderscorestring** | **map[String, string]** | | [optional] [default to null] +**mapUnderscorenumber** | **map[String, integer]** | | [optional] [default to null] +**mapUnderscoreinteger** | **map[String, integer]** | | [optional] [default to null] +**mapUnderscoreboolean** | **map[String, boolean]** | | [optional] [default to null] +**mapUnderscorearrayUnderscoreinteger** | **map[String, array[integer]]** | | [optional] [default to null] +**mapUnderscorearrayUnderscoreanytype** | **map[String, array[map]]** | | [optional] [default to null] +**mapUnderscoremapUnderscorestring** | **map[String, map[String, string]]** | | [optional] [default to null] +**mapUnderscoremapUnderscoreanytype** | **map[String, map[String, map]]** | | [optional] [default to null] +**anytypeUnderscore1** | [**map**](.md) | | [optional] [default to null] +**anytypeUnderscore2** | [**map**](.md) | | [optional] [default to null] +**anytypeUnderscore3** | [**map**](.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/AnotherFakeApi.md b/samples/client/petstore/bash/docs/AnotherFakeApi.md index 8eda10a25080..e17a9e75d006 100644 --- a/samples/client/petstore/bash/docs/AnotherFakeApi.md +++ b/samples/client/petstore/bash/docs/AnotherFakeApi.md @@ -25,7 +25,7 @@ petstore-cli call123TestSpecialTags Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md) | client model | + **body** | [**Client**](Client.md) | client model | ### Return type diff --git a/samples/client/petstore/bash/docs/EnumTest.md b/samples/client/petstore/bash/docs/EnumTest.md index 3f70a0a0667a..30b30efa7307 100644 --- a/samples/client/petstore/bash/docs/EnumTest.md +++ b/samples/client/petstore/bash/docs/EnumTest.md @@ -8,9 +8,6 @@ Name | Type | Description | Notes **enumUnderscoreinteger** | **integer** | | [optional] [default to null] **enumUnderscorenumber** | **float** | | [optional] [default to null] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] [default to null] -**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] [default to null] -**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to null] -**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/FakeApi.md b/samples/client/petstore/bash/docs/FakeApi.md index 905f6e2cd088..075407dede6d 100644 --- a/samples/client/petstore/bash/docs/FakeApi.md +++ b/samples/client/petstore/bash/docs/FakeApi.md @@ -4,7 +4,7 @@ All URIs are relative to */v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -13,9 +13,9 @@ Method | HTTP request | Description [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters -假端點 -偽のエンドポイント -가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -24,23 +24,28 @@ Method | HTTP request | Description -## fakeHealthGet +## createXmlItem -Health check endpoint +creates an XmlItem + +this route creates an XmlItem ### Example ```bash -petstore-cli fakeHealthGet +petstore-cli createXmlItem ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xmlItem** | [**XmlItem**](XmlItem.md) | XmlItem Body | ### Return type -[**HealthCheckResult**](HealthCheckResult.md) +(empty response body) ### Authorization @@ -48,8 +53,8 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable -- **Accept**: application/json +- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 +- **Accept**: Not Applicable [[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) @@ -83,7 +88,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not Applicable - **Accept**: */* [[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) @@ -106,7 +111,7 @@ petstore-cli fakeOuterCompositeSerialize Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **outerComposite** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] + **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] ### Return type @@ -118,7 +123,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not Applicable - **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -153,7 +158,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not Applicable - **Accept**: */* [[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) @@ -188,7 +193,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not Applicable - **Accept**: */* [[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) @@ -211,7 +216,7 @@ petstore-cli testBodyWithFileSchema Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | ### Return type @@ -245,7 +250,7 @@ petstore-cli testBodyWithQueryParams query=value Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **string** | | [default to null] - **user** | [**User**](User.md) | | + **body** | [**User**](User.md) | | ### Return type @@ -280,7 +285,7 @@ petstore-cli testClientModel Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md) | client model | + **body** | [**Client**](Client.md) | client model | ### Return type @@ -301,14 +306,14 @@ No authorization required ## testEndpointParameters Fake endpoint for testing various parameters -假端點 -偽のエンドポイント -가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 Fake endpoint for testing various parameters -假端點 -偽のエンドポイント -가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 ### Example @@ -361,7 +366,7 @@ To test enum parameters ### Example ```bash -petstore-cli testEnumParameters enum_header_string_array:value enum_header_string:value Specify as: enum_query_string_array=value1 enum_query_string_array=value2 enum_query_string_array=... enum_query_string=value enum_query_integer=value enum_query_double=value +petstore-cli testEnumParameters enum_header_string_array:value enum_header_string:value Specify as: enum_query_string_array="value1,value2,..." enum_query_string=value enum_query_integer=value enum_query_double=value ``` ### Parameters @@ -424,7 +429,7 @@ Name | Type | Description | Notes ### Authorization -[bearer_test](../README.md#bearer_test) +No authorization required ### HTTP request headers @@ -449,7 +454,7 @@ petstore-cli testInlineAdditionalProperties Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requestBody** | [**map[String, string]**](string.md) | request body | + **param** | [**map[String, string]**](string.md) | request body | ### Return type @@ -510,7 +515,7 @@ To test the collection format in query parameters ### Example ```bash -petstore-cli testQueryParameterCollectionFormat Specify as: pipe=value1 pipe=value2 pipe=... Specify as: ioutil="value1,value2,..." Specify as: Specify as: url="value1,value2,..." Specify as: context=value1 context=value2 context=... +petstore-cli testQueryParameterCollectionFormat Specify as: pipe="value1,value2,..." Specify as: ioutil="value1,value2,..." Specify as: http="value1 value2 ..." Specify as: url="value1,value2,..." Specify as: context=value1 context=value2 context=... ``` ### Parameters diff --git a/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md b/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md index f670ef5f7b9a..19b3d386d383 100644 --- a/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md @@ -25,7 +25,7 @@ petstore-cli testClassname Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md) | client model | + **body** | [**Client**](Client.md) | client model | ### Return type diff --git a/samples/client/petstore/bash/docs/FormatTest.md b/samples/client/petstore/bash/docs/FormatTest.md index 8fe26118a9dd..385631d820c8 100644 --- a/samples/client/petstore/bash/docs/FormatTest.md +++ b/samples/client/petstore/bash/docs/FormatTest.md @@ -16,8 +16,7 @@ Name | Type | Description | Notes **dateTime** | **string** | | [optional] [default to null] **uuid** | **string** | | [optional] [default to null] **password** | **string** | | [default to null] -**patternUnderscorewithUnderscoredigits** | **string** | | [optional] [default to null] -**patternUnderscorewithUnderscoredigitsUnderscoreandUnderscoredelimiter** | **string** | | [optional] [default to null] +**BigDecimal** | [**BigDecimal**](BigDecimal.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/PetApi.md b/samples/client/petstore/bash/docs/PetApi.md index ddc4f21bffcd..320863082061 100644 --- a/samples/client/petstore/bash/docs/PetApi.md +++ b/samples/client/petstore/bash/docs/PetApi.md @@ -31,7 +31,7 @@ petstore-cli addPet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type @@ -203,7 +203,7 @@ petstore-cli updatePet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type diff --git a/samples/client/petstore/bash/docs/StoreApi.md b/samples/client/petstore/bash/docs/StoreApi.md index 58ee002b7b86..56b2934562b5 100644 --- a/samples/client/petstore/bash/docs/StoreApi.md +++ b/samples/client/petstore/bash/docs/StoreApi.md @@ -128,7 +128,7 @@ petstore-cli placeOrder Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md) | order placed for purchasing the pet | + **body** | [**Order**](Order.md) | order placed for purchasing the pet | ### Return type @@ -140,7 +140,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not Applicable - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/UserApi.md b/samples/client/petstore/bash/docs/UserApi.md index f36e39d38ee6..9663a425b732 100644 --- a/samples/client/petstore/bash/docs/UserApi.md +++ b/samples/client/petstore/bash/docs/UserApi.md @@ -32,7 +32,7 @@ petstore-cli createUser Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md) | Created user object | + **body** | [**User**](User.md) | Created user object | ### Return type @@ -44,7 +44,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not Applicable - **Accept**: Not Applicable [[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) @@ -65,7 +65,7 @@ petstore-cli createUsersWithArrayInput Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**array[User]**](User.md) | List of user object | + **body** | [**array[User]**](User.md) | List of user object | ### Return type @@ -77,7 +77,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not Applicable - **Accept**: Not Applicable [[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) @@ -98,7 +98,7 @@ petstore-cli createUsersWithListInput Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**array[User]**](User.md) | List of user object | + **body** | [**array[User]**](User.md) | List of user object | ### Return type @@ -110,7 +110,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not Applicable - **Accept**: Not Applicable [[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) @@ -266,7 +266,7 @@ petstore-cli updateUser username=value Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string** | name that need to be deleted | [default to null] - **user** | [**User**](User.md) | Updated user object | + **body** | [**User**](User.md) | Updated user object | ### Return type @@ -278,7 +278,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not Applicable - **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index 7e496f60eeca..3ea2de2a6a6c 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -95,15 +95,16 @@ declare -a result_color_table=( "$WHITE" "$WHITE" "$GREEN" "$YELLOW" "$WHITE" "$ # 0 - optional # 1 - required declare -A operation_parameters_minimum_occurrences -operation_parameters_minimum_occurrences["call123TestSpecialTags:::Client"]=1 +operation_parameters_minimum_occurrences["call123TestSpecialTags:::body"]=1 +operation_parameters_minimum_occurrences["createXmlItem:::XmlItem"]=1 operation_parameters_minimum_occurrences["fakeOuterBooleanSerialize:::body"]=0 -operation_parameters_minimum_occurrences["fakeOuterCompositeSerialize:::OuterComposite"]=0 +operation_parameters_minimum_occurrences["fakeOuterCompositeSerialize:::body"]=0 operation_parameters_minimum_occurrences["fakeOuterNumberSerialize:::body"]=0 operation_parameters_minimum_occurrences["fakeOuterStringSerialize:::body"]=0 -operation_parameters_minimum_occurrences["testBodyWithFileSchema:::FileSchemaTestClass"]=1 +operation_parameters_minimum_occurrences["testBodyWithFileSchema:::body"]=1 operation_parameters_minimum_occurrences["testBodyWithQueryParams:::query"]=1 -operation_parameters_minimum_occurrences["testBodyWithQueryParams:::User"]=1 -operation_parameters_minimum_occurrences["testClientModel:::Client"]=1 +operation_parameters_minimum_occurrences["testBodyWithQueryParams:::body"]=1 +operation_parameters_minimum_occurrences["testClientModel:::body"]=1 operation_parameters_minimum_occurrences["testEndpointParameters:::number"]=1 operation_parameters_minimum_occurrences["testEndpointParameters:::double"]=1 operation_parameters_minimum_occurrences["testEndpointParameters:::pattern_without_delimiter"]=1 @@ -132,7 +133,7 @@ operation_parameters_minimum_occurrences["testGroupParameters:::required_int64_g operation_parameters_minimum_occurrences["testGroupParameters:::string_group"]=0 operation_parameters_minimum_occurrences["testGroupParameters:::boolean_group"]=0 operation_parameters_minimum_occurrences["testGroupParameters:::int64_group"]=0 -operation_parameters_minimum_occurrences["testInlineAdditionalProperties:::request_body"]=1 +operation_parameters_minimum_occurrences["testInlineAdditionalProperties:::param"]=1 operation_parameters_minimum_occurrences["testJsonFormData:::param"]=1 operation_parameters_minimum_occurrences["testJsonFormData:::param2"]=1 operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::pipe"]=1 @@ -140,14 +141,14 @@ operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::i operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::http"]=1 operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::url"]=1 operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::context"]=1 -operation_parameters_minimum_occurrences["testClassname:::Client"]=1 -operation_parameters_minimum_occurrences["addPet:::Pet"]=1 +operation_parameters_minimum_occurrences["testClassname:::body"]=1 +operation_parameters_minimum_occurrences["addPet:::body"]=1 operation_parameters_minimum_occurrences["deletePet:::petId"]=1 operation_parameters_minimum_occurrences["deletePet:::api_key"]=0 operation_parameters_minimum_occurrences["findPetsByStatus:::status"]=1 operation_parameters_minimum_occurrences["findPetsByTags:::tags"]=1 operation_parameters_minimum_occurrences["getPetById:::petId"]=1 -operation_parameters_minimum_occurrences["updatePet:::Pet"]=1 +operation_parameters_minimum_occurrences["updatePet:::body"]=1 operation_parameters_minimum_occurrences["updatePetWithForm:::petId"]=1 operation_parameters_minimum_occurrences["updatePetWithForm:::name"]=0 operation_parameters_minimum_occurrences["updatePetWithForm:::status"]=0 @@ -159,16 +160,16 @@ operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::requiredF operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::additionalMetadata"]=0 operation_parameters_minimum_occurrences["deleteOrder:::order_id"]=1 operation_parameters_minimum_occurrences["getOrderById:::order_id"]=1 -operation_parameters_minimum_occurrences["placeOrder:::Order"]=1 -operation_parameters_minimum_occurrences["createUser:::User"]=1 -operation_parameters_minimum_occurrences["createUsersWithArrayInput:::User"]=1 -operation_parameters_minimum_occurrences["createUsersWithListInput:::User"]=1 +operation_parameters_minimum_occurrences["placeOrder:::body"]=1 +operation_parameters_minimum_occurrences["createUser:::body"]=1 +operation_parameters_minimum_occurrences["createUsersWithArrayInput:::body"]=1 +operation_parameters_minimum_occurrences["createUsersWithListInput:::body"]=1 operation_parameters_minimum_occurrences["deleteUser:::username"]=1 operation_parameters_minimum_occurrences["getUserByName:::username"]=1 operation_parameters_minimum_occurrences["loginUser:::username"]=1 operation_parameters_minimum_occurrences["loginUser:::password"]=1 operation_parameters_minimum_occurrences["updateUser:::username"]=1 -operation_parameters_minimum_occurrences["updateUser:::User"]=1 +operation_parameters_minimum_occurrences["updateUser:::body"]=1 ## # This array stores the maximum number of allowed occurrences for parameter @@ -177,15 +178,16 @@ operation_parameters_minimum_occurrences["updateUser:::User"]=1 # N - N values # 0 - unlimited declare -A operation_parameters_maximum_occurrences -operation_parameters_maximum_occurrences["call123TestSpecialTags:::Client"]=0 +operation_parameters_maximum_occurrences["call123TestSpecialTags:::body"]=0 +operation_parameters_maximum_occurrences["createXmlItem:::XmlItem"]=0 operation_parameters_maximum_occurrences["fakeOuterBooleanSerialize:::body"]=0 -operation_parameters_maximum_occurrences["fakeOuterCompositeSerialize:::OuterComposite"]=0 +operation_parameters_maximum_occurrences["fakeOuterCompositeSerialize:::body"]=0 operation_parameters_maximum_occurrences["fakeOuterNumberSerialize:::body"]=0 operation_parameters_maximum_occurrences["fakeOuterStringSerialize:::body"]=0 -operation_parameters_maximum_occurrences["testBodyWithFileSchema:::FileSchemaTestClass"]=0 +operation_parameters_maximum_occurrences["testBodyWithFileSchema:::body"]=0 operation_parameters_maximum_occurrences["testBodyWithQueryParams:::query"]=0 -operation_parameters_maximum_occurrences["testBodyWithQueryParams:::User"]=0 -operation_parameters_maximum_occurrences["testClientModel:::Client"]=0 +operation_parameters_maximum_occurrences["testBodyWithQueryParams:::body"]=0 +operation_parameters_maximum_occurrences["testClientModel:::body"]=0 operation_parameters_maximum_occurrences["testEndpointParameters:::number"]=0 operation_parameters_maximum_occurrences["testEndpointParameters:::double"]=0 operation_parameters_maximum_occurrences["testEndpointParameters:::pattern_without_delimiter"]=0 @@ -214,7 +216,7 @@ operation_parameters_maximum_occurrences["testGroupParameters:::required_int64_g operation_parameters_maximum_occurrences["testGroupParameters:::string_group"]=0 operation_parameters_maximum_occurrences["testGroupParameters:::boolean_group"]=0 operation_parameters_maximum_occurrences["testGroupParameters:::int64_group"]=0 -operation_parameters_maximum_occurrences["testInlineAdditionalProperties:::request_body"]=0 +operation_parameters_maximum_occurrences["testInlineAdditionalProperties:::param"]=0 operation_parameters_maximum_occurrences["testJsonFormData:::param"]=0 operation_parameters_maximum_occurrences["testJsonFormData:::param2"]=0 operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::pipe"]=0 @@ -222,14 +224,14 @@ operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::i operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::http"]=0 operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::url"]=0 operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::context"]=0 -operation_parameters_maximum_occurrences["testClassname:::Client"]=0 -operation_parameters_maximum_occurrences["addPet:::Pet"]=0 +operation_parameters_maximum_occurrences["testClassname:::body"]=0 +operation_parameters_maximum_occurrences["addPet:::body"]=0 operation_parameters_maximum_occurrences["deletePet:::petId"]=0 operation_parameters_maximum_occurrences["deletePet:::api_key"]=0 operation_parameters_maximum_occurrences["findPetsByStatus:::status"]=0 operation_parameters_maximum_occurrences["findPetsByTags:::tags"]=0 operation_parameters_maximum_occurrences["getPetById:::petId"]=0 -operation_parameters_maximum_occurrences["updatePet:::Pet"]=0 +operation_parameters_maximum_occurrences["updatePet:::body"]=0 operation_parameters_maximum_occurrences["updatePetWithForm:::petId"]=0 operation_parameters_maximum_occurrences["updatePetWithForm:::name"]=0 operation_parameters_maximum_occurrences["updatePetWithForm:::status"]=0 @@ -241,30 +243,31 @@ operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::requiredF operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::additionalMetadata"]=0 operation_parameters_maximum_occurrences["deleteOrder:::order_id"]=0 operation_parameters_maximum_occurrences["getOrderById:::order_id"]=0 -operation_parameters_maximum_occurrences["placeOrder:::Order"]=0 -operation_parameters_maximum_occurrences["createUser:::User"]=0 -operation_parameters_maximum_occurrences["createUsersWithArrayInput:::User"]=0 -operation_parameters_maximum_occurrences["createUsersWithListInput:::User"]=0 +operation_parameters_maximum_occurrences["placeOrder:::body"]=0 +operation_parameters_maximum_occurrences["createUser:::body"]=0 +operation_parameters_maximum_occurrences["createUsersWithArrayInput:::body"]=0 +operation_parameters_maximum_occurrences["createUsersWithListInput:::body"]=0 operation_parameters_maximum_occurrences["deleteUser:::username"]=0 operation_parameters_maximum_occurrences["getUserByName:::username"]=0 operation_parameters_maximum_occurrences["loginUser:::username"]=0 operation_parameters_maximum_occurrences["loginUser:::password"]=0 operation_parameters_maximum_occurrences["updateUser:::username"]=0 -operation_parameters_maximum_occurrences["updateUser:::User"]=0 +operation_parameters_maximum_occurrences["updateUser:::body"]=0 ## # The type of collection for specifying multiple values for parameter: # - multi, csv, ssv, tsv declare -A operation_parameters_collection_type -operation_parameters_collection_type["call123TestSpecialTags:::Client"]="" +operation_parameters_collection_type["call123TestSpecialTags:::body"]="" +operation_parameters_collection_type["createXmlItem:::XmlItem"]="" operation_parameters_collection_type["fakeOuterBooleanSerialize:::body"]="" -operation_parameters_collection_type["fakeOuterCompositeSerialize:::OuterComposite"]="" +operation_parameters_collection_type["fakeOuterCompositeSerialize:::body"]="" operation_parameters_collection_type["fakeOuterNumberSerialize:::body"]="" operation_parameters_collection_type["fakeOuterStringSerialize:::body"]="" -operation_parameters_collection_type["testBodyWithFileSchema:::FileSchemaTestClass"]="" +operation_parameters_collection_type["testBodyWithFileSchema:::body"]="" operation_parameters_collection_type["testBodyWithQueryParams:::query"]="" -operation_parameters_collection_type["testBodyWithQueryParams:::User"]="" -operation_parameters_collection_type["testClientModel:::Client"]="" +operation_parameters_collection_type["testBodyWithQueryParams:::body"]="" +operation_parameters_collection_type["testClientModel:::body"]="" operation_parameters_collection_type["testEndpointParameters:::number"]="" operation_parameters_collection_type["testEndpointParameters:::double"]="" operation_parameters_collection_type["testEndpointParameters:::pattern_without_delimiter"]="" @@ -281,7 +284,7 @@ operation_parameters_collection_type["testEndpointParameters:::password"]="" operation_parameters_collection_type["testEndpointParameters:::callback"]="" operation_parameters_collection_type["testEnumParameters:::enum_header_string_array"]="csv" operation_parameters_collection_type["testEnumParameters:::enum_header_string"]="" -operation_parameters_collection_type["testEnumParameters:::enum_query_string_array"]="multi" +operation_parameters_collection_type["testEnumParameters:::enum_query_string_array"]="csv" operation_parameters_collection_type["testEnumParameters:::enum_query_string"]="" operation_parameters_collection_type["testEnumParameters:::enum_query_integer"]="" operation_parameters_collection_type["testEnumParameters:::enum_query_double"]="" @@ -293,22 +296,22 @@ operation_parameters_collection_type["testGroupParameters:::required_int64_group operation_parameters_collection_type["testGroupParameters:::string_group"]="" operation_parameters_collection_type["testGroupParameters:::boolean_group"]="" operation_parameters_collection_type["testGroupParameters:::int64_group"]="" -operation_parameters_collection_type["testInlineAdditionalProperties:::request_body"]= +operation_parameters_collection_type["testInlineAdditionalProperties:::param"]= operation_parameters_collection_type["testJsonFormData:::param"]="" operation_parameters_collection_type["testJsonFormData:::param2"]="" -operation_parameters_collection_type["testQueryParameterCollectionFormat:::pipe"]="multi" +operation_parameters_collection_type["testQueryParameterCollectionFormat:::pipe"]="csv" operation_parameters_collection_type["testQueryParameterCollectionFormat:::ioutil"]="csv" -operation_parameters_collection_type["testQueryParameterCollectionFormat:::http"]= +operation_parameters_collection_type["testQueryParameterCollectionFormat:::http"]="ssv" operation_parameters_collection_type["testQueryParameterCollectionFormat:::url"]="csv" operation_parameters_collection_type["testQueryParameterCollectionFormat:::context"]="multi" -operation_parameters_collection_type["testClassname:::Client"]="" -operation_parameters_collection_type["addPet:::Pet"]="" +operation_parameters_collection_type["testClassname:::body"]="" +operation_parameters_collection_type["addPet:::body"]="" operation_parameters_collection_type["deletePet:::petId"]="" operation_parameters_collection_type["deletePet:::api_key"]="" operation_parameters_collection_type["findPetsByStatus:::status"]="csv" operation_parameters_collection_type["findPetsByTags:::tags"]="csv" operation_parameters_collection_type["getPetById:::petId"]="" -operation_parameters_collection_type["updatePet:::Pet"]="" +operation_parameters_collection_type["updatePet:::body"]="" operation_parameters_collection_type["updatePetWithForm:::petId"]="" operation_parameters_collection_type["updatePetWithForm:::name"]="" operation_parameters_collection_type["updatePetWithForm:::status"]="" @@ -320,16 +323,16 @@ operation_parameters_collection_type["uploadFileWithRequiredFile:::requiredFile" operation_parameters_collection_type["uploadFileWithRequiredFile:::additionalMetadata"]="" operation_parameters_collection_type["deleteOrder:::order_id"]="" operation_parameters_collection_type["getOrderById:::order_id"]="" -operation_parameters_collection_type["placeOrder:::Order"]="" -operation_parameters_collection_type["createUser:::User"]="" -operation_parameters_collection_type["createUsersWithArrayInput:::User"]= -operation_parameters_collection_type["createUsersWithListInput:::User"]= +operation_parameters_collection_type["placeOrder:::body"]="" +operation_parameters_collection_type["createUser:::body"]="" +operation_parameters_collection_type["createUsersWithArrayInput:::body"]= +operation_parameters_collection_type["createUsersWithListInput:::body"]= operation_parameters_collection_type["deleteUser:::username"]="" operation_parameters_collection_type["getUserByName:::username"]="" operation_parameters_collection_type["loginUser:::username"]="" operation_parameters_collection_type["loginUser:::password"]="" operation_parameters_collection_type["updateUser:::username"]="" -operation_parameters_collection_type["updateUser:::User"]="" +operation_parameters_collection_type["updateUser:::body"]="" ## @@ -722,8 +725,6 @@ EOF echo -e " or export ${RED}PETSTORE_API_KEY=''${OFF}" echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u :' before ${YELLOW}${OFF}" echo -e " or export ${RED}PETSTORE_BASIC_AUTH=':'${OFF}" - echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u :' before ${YELLOW}${OFF}" - echo -e " or export ${RED}PETSTORE_BASIC_AUTH=':'${OFF}" echo -e " - ${MAGENTA}OAuth2 (flow: implicit)${OFF}" echo -e " Authorization URL: " echo -e " * http://petstore.swagger.io/api/oauth/dialog" @@ -737,17 +738,11 @@ EOF read -r -d '' ops <&1 | grep -v 'To https' diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj index 4dc96302b70a..22154d797a8d 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj @@ -15,13 +15,13 @@ (defn-spec add-pet-with-http-info any? "Add a new pet to the store" ([] (add-pet-with-http-info nil)) - ([{:keys [pet]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/pet" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param pet + :body-param body :content-types ["application/json" "application/xml"] :accepts [] :auth-names ["petstore_auth"]}))) @@ -137,13 +137,13 @@ (defn-spec update-pet-with-http-info any? "Update an existing pet" ([] (update-pet-with-http-info nil)) - ([{:keys [pet]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/pet" :put {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param pet + :body-param body :content-types ["application/json" "application/xml"] :accepts [] :auth-names ["petstore_auth"]}))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj index a91c086c3fd4..aa35487c2f55 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj @@ -86,13 +86,13 @@ (defn-spec place-order-with-http-info any? "Place an order for a pet" ([] (place-order-with-http-info nil)) - ([{:keys [order]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/store/order" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param order + :body-param body :content-types [] :accepts ["application/json" "application/xml"] :auth-names []}))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj index ee758efedcd6..301195b823ad 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj @@ -16,13 +16,13 @@ "Create user This can only be done by the logged in user." ([] (create-user-with-http-info nil)) - ([{:keys [user]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/user" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param user + :body-param body :content-types [] :accepts [] :auth-names []}))) @@ -41,13 +41,13 @@ (defn-spec create-users-with-array-input-with-http-info any? "Creates list of users with given input array" ([] (create-users-with-array-input-with-http-info nil)) - ([{:keys [user]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/user/createWithArray" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param user + :body-param body :content-types [] :accepts [] :auth-names []}))) @@ -65,13 +65,13 @@ (defn-spec create-users-with-list-input-with-http-info any? "Creates list of users with given input array" ([] (create-users-with-list-input-with-http-info nil)) - ([{:keys [user]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/user/createWithList" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param user + :body-param body :content-types [] :accepts [] :auth-names []}))) @@ -180,14 +180,14 @@ "Updated user This can only be done by the logged in user." ([username string?, ] (update-user-with-http-info username nil)) - ([username string?, {:keys [user]} (s/map-of keyword? any?)] + ([username string?, {:keys [body]} (s/map-of keyword? any?)] (check-required-params username) (call-api "/user/{username}" :put {:path-params {"username" username } :header-params {} :query-params {} :form-params {} - :body-param user + :body-param body :content-types [] :accepts [] :auth-names []}))) diff --git a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION index 4395ff592326..bfbf77eb7fad 100644 --- a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.cpp b/samples/client/petstore/cpp-tizen/src/PetManager.cpp index 0c6a57eee3fe..2f273a21e10d 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/PetManager.cpp @@ -82,7 +82,7 @@ static bool addPetProcessor(MemoryStruct_s p_chunk, long code, char* errormsg, v } static bool addPetHelper(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -105,10 +105,10 @@ static bool addPetHelper(char * accessToken, JsonArray* json_array; if (isprimitive("Pet")) { - node = converttoJson(&pet, "Pet", ""); + node = converttoJson(&body, "Pet", ""); } - char *jsonStr = pet.toJson(); + char *jsonStr = body.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -167,22 +167,22 @@ static bool addPetHelper(char * accessToken, bool PetManager::addPetAsync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData) { return addPetHelper(accessToken, - pet, + body, handler, userData, true); } bool PetManager::addPetSync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData) { return addPetHelper(accessToken, - pet, + body, handler, userData, false); } @@ -796,7 +796,7 @@ static bool updatePetProcessor(MemoryStruct_s p_chunk, long code, char* errormsg } static bool updatePetHelper(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -819,10 +819,10 @@ static bool updatePetHelper(char * accessToken, JsonArray* json_array; if (isprimitive("Pet")) { - node = converttoJson(&pet, "Pet", ""); + node = converttoJson(&body, "Pet", ""); } - char *jsonStr = pet.toJson(); + char *jsonStr = body.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -881,22 +881,22 @@ static bool updatePetHelper(char * accessToken, bool PetManager::updatePetAsync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData) { return updatePetHelper(accessToken, - pet, + body, handler, userData, true); } bool PetManager::updatePetSync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData) { return updatePetHelper(accessToken, - pet, + body, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.h b/samples/client/petstore/cpp-tizen/src/PetManager.h index e3ab9a775b17..93f095441200 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.h +++ b/samples/client/petstore/cpp-tizen/src/PetManager.h @@ -28,26 +28,26 @@ class PetManager { /*! \brief Add a new pet to the store. *Synchronous* * * - * \param pet Pet object that needs to be added to the store *Required* + * \param body Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool addPetSync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData); /*! \brief Add a new pet to the store. *Asynchronous* * * - * \param pet Pet object that needs to be added to the store *Required* + * \param body Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool addPetAsync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData); @@ -165,26 +165,26 @@ bool getPetByIdAsync(char * accessToken, /*! \brief Update an existing pet. *Synchronous* * * - * \param pet Pet object that needs to be added to the store *Required* + * \param body Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updatePetSync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData); /*! \brief Update an existing pet. *Asynchronous* * * - * \param pet Pet object that needs to be added to the store *Required* + * \param body Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updatePetAsync(char * accessToken, - Pet pet, + Pet body, void(* handler)(Error, void* ) , void* userData); diff --git a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp index 91958248d70f..e107ff844349 100644 --- a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp @@ -510,7 +510,7 @@ static bool placeOrderProcessor(MemoryStruct_s p_chunk, long code, char* errorms } static bool placeOrderHelper(char * accessToken, - Order order, + Order body, void(* handler)(Order, Error, void* ) , void* userData, bool isAsync) { @@ -532,10 +532,10 @@ static bool placeOrderHelper(char * accessToken, JsonArray* json_array; if (isprimitive("Order")) { - node = converttoJson(&order, "Order", ""); + node = converttoJson(&body, "Order", ""); } - char *jsonStr = order.toJson(); + char *jsonStr = body.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -594,22 +594,22 @@ static bool placeOrderHelper(char * accessToken, bool StoreManager::placeOrderAsync(char * accessToken, - Order order, + Order body, void(* handler)(Order, Error, void* ) , void* userData) { return placeOrderHelper(accessToken, - order, + body, handler, userData, true); } bool StoreManager::placeOrderSync(char * accessToken, - Order order, + Order body, void(* handler)(Order, Error, void* ) , void* userData) { return placeOrderHelper(accessToken, - order, + body, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/StoreManager.h b/samples/client/petstore/cpp-tizen/src/StoreManager.h index ac172733f735..9736475b3810 100644 --- a/samples/client/petstore/cpp-tizen/src/StoreManager.h +++ b/samples/client/petstore/cpp-tizen/src/StoreManager.h @@ -107,26 +107,26 @@ bool getOrderByIdAsync(char * accessToken, /*! \brief Place an order for a pet. *Synchronous* * * - * \param order order placed for purchasing the pet *Required* + * \param body order placed for purchasing the pet *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool placeOrderSync(char * accessToken, - Order order, + Order body, void(* handler)(Order, Error, void* ) , void* userData); /*! \brief Place an order for a pet. *Asynchronous* * * - * \param order order placed for purchasing the pet *Required* + * \param body order placed for purchasing the pet *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool placeOrderAsync(char * accessToken, - Order order, + Order body, void(* handler)(Order, Error, void* ) , void* userData); diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.cpp b/samples/client/petstore/cpp-tizen/src/UserManager.cpp index bd51f9bc0516..ab3a7e40964f 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/UserManager.cpp @@ -82,7 +82,7 @@ static bool createUserProcessor(MemoryStruct_s p_chunk, long code, char* errorms } static bool createUserHelper(char * accessToken, - User user, + User body, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -104,10 +104,10 @@ static bool createUserHelper(char * accessToken, JsonArray* json_array; if (isprimitive("User")) { - node = converttoJson(&user, "User", ""); + node = converttoJson(&body, "User", ""); } - char *jsonStr = user.toJson(); + char *jsonStr = body.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -166,22 +166,22 @@ static bool createUserHelper(char * accessToken, bool UserManager::createUserAsync(char * accessToken, - User user, + User body, void(* handler)(Error, void* ) , void* userData) { return createUserHelper(accessToken, - user, + body, handler, userData, true); } bool UserManager::createUserSync(char * accessToken, - User user, + User body, void(* handler)(Error, void* ) , void* userData) { return createUserHelper(accessToken, - user, + body, handler, userData, false); } @@ -219,7 +219,7 @@ static bool createUsersWithArrayInputProcessor(MemoryStruct_s p_chunk, long code } static bool createUsersWithArrayInputHelper(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -240,14 +240,14 @@ static bool createUsersWithArrayInputHelper(char * accessToken, JsonNode* node; JsonArray* json_array; //TODO: Map Container - if (isprimitive("std::list")) { - node = converttoJson(&user, "std::list", "array"); + if (isprimitive("User")) { + node = converttoJson(&body, "User", "array"); } else { node = json_node_alloc(); json_array = json_array_new(); for (std::list - ::iterator bodyIter = user.begin(); bodyIter != user.end(); ++bodyIter) { - std::list itemAt = (*bodyIter); + ::iterator bodyIter = body.begin(); bodyIter != body.end(); ++bodyIter) { + User itemAt = (*bodyIter); char *jsonStr = itemAt.toJson(); JsonNode *node_temp = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -315,22 +315,22 @@ static bool createUsersWithArrayInputHelper(char * accessToken, bool UserManager::createUsersWithArrayInputAsync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData) { return createUsersWithArrayInputHelper(accessToken, - user, + body, handler, userData, true); } bool UserManager::createUsersWithArrayInputSync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData) { return createUsersWithArrayInputHelper(accessToken, - user, + body, handler, userData, false); } @@ -368,7 +368,7 @@ static bool createUsersWithListInputProcessor(MemoryStruct_s p_chunk, long code, } static bool createUsersWithListInputHelper(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -389,14 +389,14 @@ static bool createUsersWithListInputHelper(char * accessToken, JsonNode* node; JsonArray* json_array; //TODO: Map Container - if (isprimitive("std::list")) { - node = converttoJson(&user, "std::list", "array"); + if (isprimitive("User")) { + node = converttoJson(&body, "User", "array"); } else { node = json_node_alloc(); json_array = json_array_new(); for (std::list - ::iterator bodyIter = user.begin(); bodyIter != user.end(); ++bodyIter) { - std::list itemAt = (*bodyIter); + ::iterator bodyIter = body.begin(); bodyIter != body.end(); ++bodyIter) { + User itemAt = (*bodyIter); char *jsonStr = itemAt.toJson(); JsonNode *node_temp = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -464,22 +464,22 @@ static bool createUsersWithListInputHelper(char * accessToken, bool UserManager::createUsersWithListInputAsync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData) { return createUsersWithListInputHelper(accessToken, - user, + body, handler, userData, true); } bool UserManager::createUsersWithListInputSync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData) { return createUsersWithListInputHelper(accessToken, - user, + body, handler, userData, false); } @@ -1072,7 +1072,7 @@ static bool updateUserProcessor(MemoryStruct_s p_chunk, long code, char* errorms } static bool updateUserHelper(char * accessToken, - std::string username, User user, + std::string username, User body, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -1094,10 +1094,10 @@ static bool updateUserHelper(char * accessToken, JsonArray* json_array; if (isprimitive("User")) { - node = converttoJson(&user, "User", ""); + node = converttoJson(&body, "User", ""); } - char *jsonStr = user.toJson(); + char *jsonStr = body.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -1162,22 +1162,22 @@ static bool updateUserHelper(char * accessToken, bool UserManager::updateUserAsync(char * accessToken, - std::string username, User user, + std::string username, User body, void(* handler)(Error, void* ) , void* userData) { return updateUserHelper(accessToken, - username, user, + username, body, handler, userData, true); } bool UserManager::updateUserSync(char * accessToken, - std::string username, User user, + std::string username, User body, void(* handler)(Error, void* ) , void* userData) { return updateUserHelper(accessToken, - username, user, + username, body, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.h b/samples/client/petstore/cpp-tizen/src/UserManager.h index 7429af29f3aa..0b72c159294c 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.h +++ b/samples/client/petstore/cpp-tizen/src/UserManager.h @@ -28,26 +28,26 @@ class UserManager { /*! \brief Create user. *Synchronous* * * This can only be done by the logged in user. - * \param user Created user object *Required* + * \param body Created user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUserSync(char * accessToken, - User user, + User body, void(* handler)(Error, void* ) , void* userData); /*! \brief Create user. *Asynchronous* * * This can only be done by the logged in user. - * \param user Created user object *Required* + * \param body Created user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUserAsync(char * accessToken, - User user, + User body, void(* handler)(Error, void* ) , void* userData); @@ -55,26 +55,26 @@ bool createUserAsync(char * accessToken, /*! \brief Creates list of users with given input array. *Synchronous* * * - * \param user List of user object *Required* + * \param body List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithArrayInputSync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData); /*! \brief Creates list of users with given input array. *Asynchronous* * * - * \param user List of user object *Required* + * \param body List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithArrayInputAsync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData); @@ -82,26 +82,26 @@ bool createUsersWithArrayInputAsync(char * accessToken, /*! \brief Creates list of users with given input array. *Synchronous* * * - * \param user List of user object *Required* + * \param body List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithListInputSync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData); /*! \brief Creates list of users with given input array. *Asynchronous* * * - * \param user List of user object *Required* + * \param body List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithListInputAsync(char * accessToken, - std::list user, + std::list body, void(* handler)(Error, void* ) , void* userData); @@ -218,13 +218,13 @@ bool logoutUserAsync(char * accessToken, * * This can only be done by the logged in user. * \param username name that need to be deleted *Required* - * \param user Updated user object *Required* + * \param body Updated user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updateUserSync(char * accessToken, - std::string username, User user, + std::string username, User body, void(* handler)(Error, void* ) , void* userData); @@ -232,13 +232,13 @@ bool updateUserSync(char * accessToken, * * This can only be done by the logged in user. * \param username name that need to be deleted *Required* - * \param user Updated user object *Required* + * \param body Updated user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updateUserAsync(char * accessToken, - std::string username, User user, + std::string username, User body, void(* handler)(Error, void* ) , void* userData); diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION index c3a2c7076fa8..bfbf77eb7fad 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file 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 a4ab49f4424d..02a246e64f9c 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 @@ -2697,7 +2697,7 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); } if (url != null) { @@ -2795,7 +2795,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); } if (url != 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 a4ab49f4424d..02a246e64f9c 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 @@ -2697,7 +2697,7 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); } if (url != null) { @@ -2795,7 +2795,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 8739ddfa49a1..91165c854fa5 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -2949,7 +2949,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3038,7 +3038,7 @@ public async System.Threading.Tasks.Task> TestQueryParameter if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/.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/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs index ec114cf37c7a..d5a4cc4d5c79 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 @@ -1567,7 +1567,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/.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/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs index 7da4d32ecbc6..db577577708c 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 @@ -1567,7 +1567,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION index c3a2c7076fa8..bfbf77eb7fad 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md index a5bb974627f4..19c69aa88d0b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/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 @@ -135,6 +135,8 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.BigCat](docs/BigCat.md) + - [Model.BigCatAllOf](docs/BigCatAllOf.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) - [Model.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md index a295fe0554f1..edffb58d3c79 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/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/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs index 9eb33690b176..52f449f7e866 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs @@ -195,10 +195,10 @@ public interface IFakeApi : IApiAccessor /// 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 @@ public interface IFakeApi : IApiAccessor 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 @@ public interface IFakeApi : IApiAccessor /// 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 @@ public interface IFakeApi : IApiAccessor 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 @@ public async System.Threading.Tasks.Task> TestClientMod } /// - /// 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 @@ public async System.Threading.Tasks.Task> TestClientMod } /// - /// 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 @@ public async System.Threading.Tasks.Task> TestClientMod } /// - /// 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 @@ public async System.Threading.Tasks.Task> TestClientMod } /// - /// 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 @@ -2949,7 +2949,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3038,7 +3038,7 @@ public async System.Threading.Tasks.Task> TestQueryParameter if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs index 3d9c30ab1fcb..4b8e41dc2a13 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs @@ -259,6 +259,8 @@ public string ParameterToString(object obj) // 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/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs index 7f63524790a4..1f209ecbc1c4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs @@ -30,6 +30,7 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] public partial class Animal : IEquatable { /// diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.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/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs index 6195602de816..52f449f7e866 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 @@ -2949,7 +2949,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3038,7 +3038,7 @@ public async System.Threading.Tasks.Task> TestQueryParameter if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.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/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs index 8739ddfa49a1..91165c854fa5 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 @@ -2949,7 +2949,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3038,7 +3038,7 @@ public async System.Threading.Tasks.Task> TestQueryParameter if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/dart-dio/.openapi-generator/VERSION b/samples/client/petstore/dart-dio/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/client/petstore/dart-dio/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-dio/.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/client/petstore/eiffel/.openapi-generator/VERSION b/samples/client/petstore/eiffel/.openapi-generator/VERSION index 096bf47efe31..bfbf77eb7fad 100644 --- a/samples/client/petstore/eiffel/.openapi-generator/VERSION +++ b/samples/client/petstore/eiffel/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/eiffel/README.md b/samples/client/petstore/eiffel/README.md index bb363368532d..3a4dc717587c 100644 --- a/samples/client/petstore/eiffel/README.md +++ b/samples/client/petstore/eiffel/README.md @@ -21,17 +21,21 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*ANOTHERFAKE_API* | [**test_special_tags**](docs/ANOTHERFAKE_API.md#test_special_tags) | **Patch** /another-fake/dummy | To test special tags +*ANOTHERFAKE_API* | [**123_test_special_tags**](docs/ANOTHERFAKE_API.md#123_test_special_tags) | **Patch** /another-fake/dummy | To test special tags +*FAKE_API* | [**create_xml_item**](docs/FAKE_API.md#create_xml_item) | **Post** /fake/create_xml_item | creates an XmlItem *FAKE_API* | [**fake_outer_boolean_serialize**](docs/FAKE_API.md#fake_outer_boolean_serialize) | **Post** /fake/outer/boolean | *FAKE_API* | [**fake_outer_composite_serialize**](docs/FAKE_API.md#fake_outer_composite_serialize) | **Post** /fake/outer/composite | *FAKE_API* | [**fake_outer_number_serialize**](docs/FAKE_API.md#fake_outer_number_serialize) | **Post** /fake/outer/number | *FAKE_API* | [**fake_outer_string_serialize**](docs/FAKE_API.md#fake_outer_string_serialize) | **Post** /fake/outer/string | +*FAKE_API* | [**test_body_with_file_schema**](docs/FAKE_API.md#test_body_with_file_schema) | **Put** /fake/body-with-file-schema | *FAKE_API* | [**test_body_with_query_params**](docs/FAKE_API.md#test_body_with_query_params) | **Put** /fake/body-with-query-params | *FAKE_API* | [**test_client_model**](docs/FAKE_API.md#test_client_model) | **Patch** /fake | To test \"client\" model -*FAKE_API* | [**test_endpoint_parameters**](docs/FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FAKE_API* | [**test_endpoint_parameters**](docs/FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FAKE_API* | [**test_enum_parameters**](docs/FAKE_API.md#test_enum_parameters) | **Get** /fake | To test enum parameters +*FAKE_API* | [**test_group_parameters**](docs/FAKE_API.md#test_group_parameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) *FAKE_API* | [**test_inline_additional_properties**](docs/FAKE_API.md#test_inline_additional_properties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties *FAKE_API* | [**test_json_form_data**](docs/FAKE_API.md#test_json_form_data) | **Get** /fake/jsonFormData | test json serialization of form data +*FAKE_API* | [**test_query_parameter_collection_format**](docs/FAKE_API.md#test_query_parameter_collection_format) | **Put** /fake/test-query-paramters | *FAKECLASSNAMETAGS123_API* | [**test_classname**](docs/FAKECLASSNAMETAGS123_API.md#test_classname) | **Patch** /fake_classname_test | To test class name in snake case *PET_API* | [**add_pet**](docs/PET_API.md#add_pet) | **Post** /pet | Add a new pet to the store *PET_API* | [**delete_pet**](docs/PET_API.md#delete_pet) | **Delete** /pet/{petId} | Deletes a pet @@ -41,6 +45,7 @@ Class | Method | HTTP request | Description *PET_API* | [**update_pet**](docs/PET_API.md#update_pet) | **Put** /pet | Update an existing pet *PET_API* | [**update_pet_with_form**](docs/PET_API.md#update_pet_with_form) | **Post** /pet/{petId} | Updates a pet in the store with form data *PET_API* | [**upload_file**](docs/PET_API.md#upload_file) | **Post** /pet/{petId}/uploadImage | uploads an image +*PET_API* | [**upload_file_with_required_file**](docs/PET_API.md#upload_file_with_required_file) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *STORE_API* | [**delete_order**](docs/STORE_API.md#delete_order) | **Delete** /store/order/{order_id} | Delete purchase order by ID *STORE_API* | [**inventory**](docs/STORE_API.md#inventory) | **Get** /store/inventory | Returns pet inventories by status *STORE_API* | [**order_by_id**](docs/STORE_API.md#order_by_id) | **Get** /store/order/{order_id} | Find purchase order by ID @@ -57,22 +62,33 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [ADDITIONAL_PROPERTIES_ANY_TYPE](docs/ADDITIONAL_PROPERTIES_ANY_TYPE.md) + - [ADDITIONAL_PROPERTIES_ARRAY](docs/ADDITIONAL_PROPERTIES_ARRAY.md) + - [ADDITIONAL_PROPERTIES_BOOLEAN](docs/ADDITIONAL_PROPERTIES_BOOLEAN.md) - [ADDITIONAL_PROPERTIES_CLASS](docs/ADDITIONAL_PROPERTIES_CLASS.md) + - [ADDITIONAL_PROPERTIES_INTEGER](docs/ADDITIONAL_PROPERTIES_INTEGER.md) + - [ADDITIONAL_PROPERTIES_NUMBER](docs/ADDITIONAL_PROPERTIES_NUMBER.md) + - [ADDITIONAL_PROPERTIES_OBJECT](docs/ADDITIONAL_PROPERTIES_OBJECT.md) + - [ADDITIONAL_PROPERTIES_STRING](docs/ADDITIONAL_PROPERTIES_STRING.md) - [ANIMAL](docs/ANIMAL.md) - - [ANIMAL_FARM](docs/ANIMAL_FARM.md) - [API_RESPONSE](docs/API_RESPONSE.md) - [ARRAY_OF_ARRAY_OF_NUMBER_ONLY](docs/ARRAY_OF_ARRAY_OF_NUMBER_ONLY.md) - [ARRAY_OF_NUMBER_ONLY](docs/ARRAY_OF_NUMBER_ONLY.md) - [ARRAY_TEST](docs/ARRAY_TEST.md) + - [BIG_CAT](docs/BIG_CAT.md) + - [BIG_CAT_ALL_OF](docs/BIG_CAT_ALL_OF.md) - [CAPITALIZATION](docs/CAPITALIZATION.md) - [CAT](docs/CAT.md) - [CATEGORY](docs/CATEGORY.md) + - [CAT_ALL_OF](docs/CAT_ALL_OF.md) - [CLASS_MODEL](docs/CLASS_MODEL.md) - [CLIENT](docs/CLIENT.md) - [DOG](docs/DOG.md) + - [DOG_ALL_OF](docs/DOG_ALL_OF.md) - [ENUM_ARRAYS](docs/ENUM_ARRAYS.md) - [ENUM_CLASS](docs/ENUM_CLASS.md) - [ENUM_TEST](docs/ENUM_TEST.md) + - [FILE_SCHEMA_TEST_CLASS](docs/FILE_SCHEMA_TEST_CLASS.md) - [FORMAT_TEST](docs/FORMAT_TEST.md) - [HAS_ONLY_READ_ONLY](docs/HAS_ONLY_READ_ONLY.md) - [MAP_TEST](docs/MAP_TEST.md) @@ -88,7 +104,10 @@ Class | Method | HTTP request | Description - [RETURN](docs/RETURN.md) - [SPECIAL_MODEL_NAME](docs/SPECIAL_MODEL_NAME.md) - [TAG](docs/TAG.md) + - [TYPE_HOLDER_DEFAULT](docs/TYPE_HOLDER_DEFAULT.md) + - [TYPE_HOLDER_EXAMPLE](docs/TYPE_HOLDER_EXAMPLE.md) - [USER](docs/USER.md) + - [XML_ITEM](docs/XML_ITEM.md) ## Documentation For Authorization diff --git a/samples/client/petstore/eiffel/api_client.ecf b/samples/client/petstore/eiffel/api_client.ecf index 6f0ef48e4822..48363565af6c 100644 --- a/samples/client/petstore/eiffel/api_client.ecf +++ b/samples/client/petstore/eiffel/api_client.ecf @@ -1,5 +1,5 @@ - + diff --git a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_CLASS.md b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_CLASS.md index 6c76a177ee5b..df287ff108ab 100644 --- a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_CLASS.md +++ b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_CLASS.md @@ -3,8 +3,17 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_property** | [**STRING_TABLE[STRING_32]**](STRING_32.md) | | [optional] [default to null] -**map_of_map_property** | [**STRING_TABLE[STRING_TABLE[STRING_32]]**](STRING_TABLE.md) | | [optional] [default to null] +**map_string** | [**STRING_TABLE[STRING_32]**](STRING_32.md) | | [optional] [default to null] +**map_number** | **STRING_TABLE[REAL_32]** | | [optional] [default to null] +**map_integer** | **STRING_TABLE[INTEGER_32]** | | [optional] [default to null] +**map_boolean** | **STRING_TABLE[BOOLEAN]** | | [optional] [default to null] +**map_array_integer** | [**STRING_TABLE[LIST [INTEGER_32]]**](LIST.md) | | [optional] [default to null] +**map_array_anytype** | [**STRING_TABLE[LIST [ANY]]**](LIST.md) | | [optional] [default to null] +**map_map_string** | [**STRING_TABLE[STRING_TABLE[STRING_32]]**](STRING_TABLE.md) | | [optional] [default to null] +**map_map_anytype** | [**STRING_TABLE[STRING_TABLE[ANY]]**](STRING_TABLE.md) | | [optional] [default to null] +**anytype_1** | [**ANY**](.md) | | [optional] [default to null] +**anytype_2** | [**ANY**](.md) | | [optional] [default to null] +**anytype_3** | [**ANY**](.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/ANOTHERFAKE_API.md b/samples/client/petstore/eiffel/docs/ANOTHERFAKE_API.md index fce27e0aa2f2..2c1e06ea5c31 100644 --- a/samples/client/petstore/eiffel/docs/ANOTHERFAKE_API.md +++ b/samples/client/petstore/eiffel/docs/ANOTHERFAKE_API.md @@ -4,23 +4,23 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- -[**test_special_tags**](ANOTHERFAKE_API.md#test_special_tags) | **Patch** /another-fake/dummy | To test special tags +[**123_test_special_tags**](ANOTHERFAKE_API.md#123_test_special_tags) | **Patch** /another-fake/dummy | To test special tags -# **test_special_tags** -> test_special_tags (client: CLIENT ): detachable CLIENT +# **123_test_special_tags** +> 123_test_special_tags (body: CLIENT ): detachable CLIENT To test special tags -To test special tags +To test special tags and operation ID starting with number ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**CLIENT**](CLIENT.md)| client model | + **body** | [**CLIENT**](CLIENT.md)| client model | ### Return type diff --git a/samples/client/petstore/eiffel/docs/CATEGORY.md b/samples/client/petstore/eiffel/docs/CATEGORY.md index de2ce34e6272..9f076ba276d0 100644 --- a/samples/client/petstore/eiffel/docs/CATEGORY.md +++ b/samples/client/petstore/eiffel/docs/CATEGORY.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **INTEGER_64** | | [optional] [default to null] -**name** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] +**name** | [**STRING_32**](STRING_32.md) | | [default to default-name] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/FAKECLASSNAMETAGS123_API.md b/samples/client/petstore/eiffel/docs/FAKECLASSNAMETAGS123_API.md index 26344acdb285..3ae91b654c26 100644 --- a/samples/client/petstore/eiffel/docs/FAKECLASSNAMETAGS123_API.md +++ b/samples/client/petstore/eiffel/docs/FAKECLASSNAMETAGS123_API.md @@ -8,7 +8,7 @@ Feature | HTTP request | Description # **test_classname** -> test_classname (client: CLIENT ): detachable CLIENT +> test_classname (body: CLIENT ): detachable CLIENT To test class name in snake case @@ -20,7 +20,7 @@ To test class name in snake case Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**CLIENT**](CLIENT.md)| client model | + **body** | [**CLIENT**](CLIENT.md)| client model | ### Return type diff --git a/samples/client/petstore/eiffel/docs/FAKE_API.md b/samples/client/petstore/eiffel/docs/FAKE_API.md index 94888d077727..d73b50161b59 100644 --- a/samples/client/petstore/eiffel/docs/FAKE_API.md +++ b/samples/client/petstore/eiffel/docs/FAKE_API.md @@ -4,18 +4,52 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- +[**create_xml_item**](FAKE_API.md#create_xml_item) | **Post** /fake/create_xml_item | creates an XmlItem [**fake_outer_boolean_serialize**](FAKE_API.md#fake_outer_boolean_serialize) | **Post** /fake/outer/boolean | [**fake_outer_composite_serialize**](FAKE_API.md#fake_outer_composite_serialize) | **Post** /fake/outer/composite | [**fake_outer_number_serialize**](FAKE_API.md#fake_outer_number_serialize) | **Post** /fake/outer/number | [**fake_outer_string_serialize**](FAKE_API.md#fake_outer_string_serialize) | **Post** /fake/outer/string | +[**test_body_with_file_schema**](FAKE_API.md#test_body_with_file_schema) | **Put** /fake/body-with-file-schema | [**test_body_with_query_params**](FAKE_API.md#test_body_with_query_params) | **Put** /fake/body-with-query-params | [**test_client_model**](FAKE_API.md#test_client_model) | **Patch** /fake | To test \"client\" model -[**test_endpoint_parameters**](FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**test_endpoint_parameters**](FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FAKE_API.md#test_enum_parameters) | **Get** /fake | To test enum parameters +[**test_group_parameters**](FAKE_API.md#test_group_parameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FAKE_API.md#test_inline_additional_properties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FAKE_API.md#test_json_form_data) | **Get** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FAKE_API.md#test_query_parameter_collection_format) | **Put** /fake/test-query-paramters | +# **create_xml_item** +> create_xml_item (xml_item: XML_ITEM ) + + +creates an XmlItem + +this route creates an XmlItem + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xml_item** | [**XML_ITEM**](XML_ITEM.md)| XmlItem Body | + +### Return type + +{empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **fake_outer_boolean_serialize** > fake_outer_boolean_serialize (body: detachable BOOLEAN ): detachable BOOLEAN @@ -47,7 +81,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **fake_outer_composite_serialize** -> fake_outer_composite_serialize (outer_composite: detachable OUTER_COMPOSITE ): detachable OUTER_COMPOSITE +> fake_outer_composite_serialize (body: detachable OUTER_COMPOSITE ): detachable OUTER_COMPOSITE @@ -59,7 +93,7 @@ Test serialization of object with outer number type Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **outer_composite** | [**OUTER_COMPOSITE**](OUTER_COMPOSITE.md)| Input composite as post body | [optional] + **body** | [**OUTER_COMPOSITE**](OUTER_COMPOSITE.md)| Input composite as post body | [optional] ### Return type @@ -136,8 +170,38 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **test_body_with_file_schema** +> test_body_with_file_schema (body: FILE_SCHEMA_TEST_CLASS ) + + + + +For this test, the body for this request much reference a schema named `File`. + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**FILE_SCHEMA_TEST_CLASS**](FILE_SCHEMA_TEST_CLASS.md)| | + +### Return type + +{empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_body_with_query_params** -> test_body_with_query_params (query: STRING_32 ; user: USER ) +> test_body_with_query_params (query: STRING_32 ; body: USER ) @@ -147,8 +211,8 @@ No authorization required Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **query** | **STRING_32**| | - **user** | [**USER**](USER.md)| | + **query** | **STRING_32**| | [default to null] + **body** | [**USER**](USER.md)| | ### Return type @@ -166,7 +230,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_client_model** -> test_client_model (client: CLIENT ): detachable CLIENT +> test_client_model (body: CLIENT ): detachable CLIENT To test \"client\" model @@ -178,7 +242,7 @@ To test \"client\" model Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**CLIENT**](CLIENT.md)| client model | + **body** | [**CLIENT**](CLIENT.md)| client model | ### Return type @@ -196,12 +260,12 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_endpoint_parameters** -> test_endpoint_parameters (number: REAL_32 ; double: REAL_64 ; pattern_without_delimiter: STRING_32 ; byte: ARRAY [NATURAL_8] ; integer: detachable INTEGER_32 ; int32: detachable INTEGER_32 ; int64: detachable INTEGER_64 ; float: detachable REAL_32 ; string: detachable STRING_32 ; binary: detachable FILE ; date: detachable DATE ; date_time: detachable DATE_TIME ; password: detachable STRING_32 ; callback: detachable STRING_32 ) +> test_endpoint_parameters (number: REAL_32 ; double: REAL_64 ; pattern_without_delimiter: STRING_32 ; byte: ARRAY [NATURAL_8] ; integer: detachable INTEGER_32 ; int32: detachable INTEGER_32 ; int64: detachable INTEGER_64 ; float: detachable REAL_32 ; string: detachable STRING_32 ; binary: detachable FILE ; date: detachable DATE ; date_time: detachable DATE_TIME ; password: detachable STRING ; callback: detachable STRING_32 ) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Parameters @@ -220,7 +284,7 @@ Name | Type | Description | Notes **binary** | **FILE**| None | [optional] [default to null] **date** | **DATE**| None | [optional] [default to null] **date_time** | **DATE_TIME**| None | [optional] [default to null] - **password** | **STRING_32**| None | [optional] [default to null] + **password** | **STRING**| None | [optional] [default to null] **callback** | **STRING_32**| None | [optional] [default to null] ### Return type @@ -251,13 +315,13 @@ To test enum parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Header parameter enum test (string array) | [optional] + **enum_header_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Header parameter enum test (string array) | [optional] [default to null] **enum_header_string** | **STRING_32**| Header parameter enum test (string) | [optional] [default to -efg] - **enum_query_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Query parameter enum test (string array) | [optional] + **enum_query_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Query parameter enum test (string array) | [optional] [default to null] **enum_query_string** | **STRING_32**| Query parameter enum test (string) | [optional] [default to -efg] - **enum_query_integer** | **INTEGER_32**| Query parameter enum test (double) | [optional] - **enum_query_double** | **REAL_64**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | **LIST [STRING_32]**| Form parameter enum test (string array) | [optional] [default to $] + **enum_query_integer** | **INTEGER_32**| Query parameter enum test (double) | [optional] [default to null] + **enum_query_double** | **REAL_64**| Query parameter enum test (double) | [optional] [default to null] + **enum_form_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Form parameter enum test (string array) | [optional] [default to $] **enum_form_string** | **STRING_32**| Form parameter enum test (string) | [optional] [default to -efg] ### Return type @@ -275,8 +339,43 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **test_group_parameters** +> test_group_parameters (required_string_group: INTEGER_32 ; required_boolean_group: BOOLEAN ; required_int64_group: INTEGER_64 ; string_group: detachable INTEGER_32 ; boolean_group: detachable BOOLEAN ; int64_group: detachable INTEGER_64 ) + + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **required_string_group** | **INTEGER_32**| Required String in group parameters | [default to null] + **required_boolean_group** | **BOOLEAN**| Required Boolean in group parameters | [default to null] + **required_int64_group** | **INTEGER_64**| Required Integer in group parameters | [default to null] + **string_group** | **INTEGER_32**| String in group parameters | [optional] [default to null] + **boolean_group** | **BOOLEAN**| Boolean in group parameters | [optional] [default to null] + **int64_group** | **INTEGER_64**| Integer in group parameters | [optional] [default to null] + +### Return type + +{empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_inline_additional_properties** -> test_inline_additional_properties (request_body: STRING_TABLE[STRING_32] ) +> test_inline_additional_properties (param: STRING_TABLE[STRING_32] ) test inline additionalProperties @@ -286,7 +385,7 @@ test inline additionalProperties Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **request_body** | [**STRING_TABLE[STRING_32]**](STRING_32.md)| request body | + **param** | [**STRING_TABLE[STRING_32]**](STRING_32.md)| request body | ### Return type @@ -332,3 +431,37 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **test_query_parameter_collection_format** +> test_query_parameter_collection_format (pipe: LIST [STRING_32] ; ioutil: LIST [STRING_32] ; http: LIST [STRING_32] ; url: LIST [STRING_32] ; context: LIST [STRING_32] ) + + + + +To test the collection format in query parameters + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**LIST [STRING_32]**](STRING_32.md)| | [default to null] + **ioutil** | [**LIST [STRING_32]**](STRING_32.md)| | [default to null] + **http** | [**LIST [STRING_32]**](STRING_32.md)| | [default to null] + **url** | [**LIST [STRING_32]**](STRING_32.md)| | [default to null] + **context** | [**LIST [STRING_32]**](STRING_32.md)| | [default to null] + +### Return type + +{empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/eiffel/docs/FORMAT_TEST.md b/samples/client/petstore/eiffel/docs/FORMAT_TEST.md index bb634fd99bf6..bb48e3e04dfd 100644 --- a/samples/client/petstore/eiffel/docs/FORMAT_TEST.md +++ b/samples/client/petstore/eiffel/docs/FORMAT_TEST.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **date** | [**DATE**](DATE.md) | | [default to null] **date_time** | [**DATE_TIME**](DATE_TIME.md) | | [optional] [default to null] **uuid** | [**UUID**](UUID.md) | | [optional] [default to null] -**password** | [**STRING_32**](STRING_32.md) | | [default to null] +**password** | [**STRING**](STRING.md) | | [default to null] +**big_decimal** | [**BIG_DECIMAL**](BigDecimal.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/HAS_ONLY_READ_ONLY.md b/samples/client/petstore/eiffel/docs/HAS_ONLY_READ_ONLY.md index 3a786e9dcbac..100044b32ae7 100644 --- a/samples/client/petstore/eiffel/docs/HAS_ONLY_READ_ONLY.md +++ b/samples/client/petstore/eiffel/docs/HAS_ONLY_READ_ONLY.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**bar** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] -**foo** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] +**bar** | [**STRING_32**](STRING_32.md) | | [optional] [readonly] [default to null] +**foo** | [**STRING_32**](STRING_32.md) | | [optional] [readonly] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/MAP_TEST.md b/samples/client/petstore/eiffel/docs/MAP_TEST.md index e55324372cbc..a4f5fbd8cc4c 100644 --- a/samples/client/petstore/eiffel/docs/MAP_TEST.md +++ b/samples/client/petstore/eiffel/docs/MAP_TEST.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **map_map_of_string** | [**STRING_TABLE[STRING_TABLE[STRING_32]]**](STRING_TABLE.md) | | [optional] [default to null] **map_of_enum_string** | [**STRING_TABLE[STRING_32]**](STRING_32.md) | | [optional] [default to null] +**direct_map** | **STRING_TABLE[BOOLEAN]** | | [optional] [default to null] +**indirect_map** | **STRING_TABLE[BOOLEAN]** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/NAME.md b/samples/client/petstore/eiffel/docs/NAME.md index 7ed9b079b81b..c19aab7e3b52 100644 --- a/samples/client/petstore/eiffel/docs/NAME.md +++ b/samples/client/petstore/eiffel/docs/NAME.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **INTEGER_32** | | [default to null] -**snake_case** | **INTEGER_32** | | [optional] [default to null] +**snake_case** | **INTEGER_32** | | [optional] [readonly] [default to null] **property** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] -**var_123_number** | **INTEGER_32** | | [optional] [default to null] +**var_123_number** | **INTEGER_32** | | [optional] [readonly] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/PET_API.md b/samples/client/petstore/eiffel/docs/PET_API.md index 2bd3122ea68b..c12e549eeae3 100644 --- a/samples/client/petstore/eiffel/docs/PET_API.md +++ b/samples/client/petstore/eiffel/docs/PET_API.md @@ -12,10 +12,11 @@ Feature | HTTP request | Description [**update_pet**](PET_API.md#update_pet) | **Put** /pet | Update an existing pet [**update_pet_with_form**](PET_API.md#update_pet_with_form) | **Post** /pet/{petId} | Updates a pet in the store with form data [**upload_file**](PET_API.md#upload_file) | **Post** /pet/{petId}/uploadImage | uploads an image +[**upload_file_with_required_file**](PET_API.md#upload_file_with_required_file) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) # **add_pet** -> add_pet (pet: PET ) +> add_pet (body: PET ) Add a new pet to the store @@ -25,7 +26,7 @@ Add a new pet to the store Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**PET**](PET.md)| Pet object that needs to be added to the store | + **body** | [**PET**](PET.md)| Pet object that needs to be added to the store | ### Return type @@ -53,8 +54,8 @@ Deletes a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| Pet id to delete | - **api_key** | **STRING_32**| | [optional] + **pet_id** | **INTEGER_64**| Pet id to delete | [default to null] + **api_key** | **STRING_32**| | [optional] [default to null] ### Return type @@ -84,7 +85,7 @@ Multiple status values can be provided with comma separated strings Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**LIST [STRING_32]**](STRING_32.md)| Status values that need to be considered for filter | + **status** | [**LIST [STRING_32]**](STRING_32.md)| Status values that need to be considered for filter | [default to null] ### Return type @@ -114,7 +115,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**LIST [STRING_32]**](STRING_32.md)| Tags to filter by | + **tags** | [**LIST [STRING_32]**](STRING_32.md)| Tags to filter by | [default to null] ### Return type @@ -144,7 +145,7 @@ Returns a single pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet to return | + **pet_id** | **INTEGER_64**| ID of pet to return | [default to null] ### Return type @@ -162,7 +163,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_pet** -> update_pet (pet: PET ) +> update_pet (body: PET ) Update an existing pet @@ -172,7 +173,7 @@ Update an existing pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**PET**](PET.md)| Pet object that needs to be added to the store | + **body** | [**PET**](PET.md)| Pet object that needs to be added to the store | ### Return type @@ -200,7 +201,7 @@ Updates a pet in the store with form data Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet that needs to be updated | + **pet_id** | **INTEGER_64**| ID of pet that needs to be updated | [default to null] **name** | **STRING_32**| Updated name of the pet | [optional] [default to null] **status** | **STRING_32**| Updated status of the pet | [optional] [default to null] @@ -230,7 +231,7 @@ uploads an image Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet to update | + **pet_id** | **INTEGER_64**| ID of pet to update | [default to null] **additional_metadata** | **STRING_32**| Additional data to pass to server | [optional] [default to null] **file** | **FILE**| file to upload | [optional] [default to null] @@ -249,3 +250,33 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **upload_file_with_required_file** +> upload_file_with_required_file (pet_id: INTEGER_64 ; required_file: FILE ; additional_metadata: detachable STRING_32 ): detachable API_RESPONSE + + +uploads an image (required) + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **INTEGER_64**| ID of pet to update | [default to null] + **required_file** | **FILE**| file to upload | [default to null] + **additional_metadata** | **STRING_32**| Additional data to pass to server | [optional] [default to null] + +### Return type + +[**API_RESPONSE**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/eiffel/docs/READ_ONLY_FIRST.md b/samples/client/petstore/eiffel/docs/READ_ONLY_FIRST.md index f6732bf11ef3..b0ec1c28b3ab 100644 --- a/samples/client/petstore/eiffel/docs/READ_ONLY_FIRST.md +++ b/samples/client/petstore/eiffel/docs/READ_ONLY_FIRST.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**bar** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] +**bar** | [**STRING_32**](STRING_32.md) | | [optional] [readonly] [default to null] **baz** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/STORE_API.md b/samples/client/petstore/eiffel/docs/STORE_API.md index c851de646130..7c081dac4ae8 100644 --- a/samples/client/petstore/eiffel/docs/STORE_API.md +++ b/samples/client/petstore/eiffel/docs/STORE_API.md @@ -23,7 +23,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **STRING_32**| ID of the order that needs to be deleted | + **order_id** | **STRING_32**| ID of the order that needs to be deleted | [default to null] ### Return type @@ -80,7 +80,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **INTEGER_64**| ID of pet that needs to be fetched | + **order_id** | **INTEGER_64**| ID of pet that needs to be fetched | [default to null] ### Return type @@ -98,7 +98,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **place_order** -> place_order (order: ORDER ): detachable ORDER +> place_order (body: ORDER ): detachable ORDER Place an order for a pet @@ -108,7 +108,7 @@ Place an order for a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**ORDER**](ORDER.md)| order placed for purchasing the pet | + **body** | [**ORDER**](ORDER.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/eiffel/docs/USER_API.md b/samples/client/petstore/eiffel/docs/USER_API.md index 686b13789fdf..8c3bb38bd920 100644 --- a/samples/client/petstore/eiffel/docs/USER_API.md +++ b/samples/client/petstore/eiffel/docs/USER_API.md @@ -15,7 +15,7 @@ Feature | HTTP request | Description # **create_user** -> create_user (user: USER ) +> create_user (body: USER ) Create user @@ -27,7 +27,7 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**USER**](USER.md)| Created user object | + **body** | [**USER**](USER.md)| Created user object | ### Return type @@ -45,7 +45,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_array_input** -> create_users_with_array_input (user: LIST [USER] ) +> create_users_with_array_input (body: LIST [USER] ) Creates list of users with given input array @@ -55,7 +55,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**LIST [USER]**](LIST.md)| List of user object | + **body** | [**LIST [USER]**](User.md)| List of user object | ### Return type @@ -73,7 +73,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_list_input** -> create_users_with_list_input (user: LIST [USER] ) +> create_users_with_list_input (body: LIST [USER] ) Creates list of users with given input array @@ -83,7 +83,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**LIST [USER]**](LIST.md)| List of user object | + **body** | [**LIST [USER]**](User.md)| List of user object | ### Return type @@ -113,7 +113,7 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The name that needs to be deleted | + **username** | **STRING_32**| The name that needs to be deleted | [default to null] ### Return type @@ -141,8 +141,8 @@ Logs user into the system Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The user name for login | - **password** | **STRING_32**| The password for login in clear text | + **username** | **STRING_32**| The user name for login | [default to null] + **password** | **STRING_32**| The password for login in clear text | [default to null] ### Return type @@ -185,7 +185,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_user** -> update_user (username: STRING_32 ; user: USER ) +> update_user (username: STRING_32 ; body: USER ) Updated user @@ -197,8 +197,8 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| name that need to be deleted | - **user** | [**USER**](USER.md)| Updated user object | + **username** | **STRING_32**| name that need to be deleted | [default to null] + **body** | [**USER**](USER.md)| Updated user object | ### Return type @@ -226,7 +226,7 @@ Get user by user name Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The name that needs to be fetched. Use user1 for testing. | + **username** | **STRING_32**| The name that needs to be fetched. Use user1 for testing. | [default to null] ### Return type diff --git a/samples/client/petstore/eiffel/src/api/another_fake_api.e b/samples/client/petstore/eiffel/src/api/another_fake_api.e index 0a912d7f8197..91ac69abea51 100644 --- a/samples/client/petstore/eiffel/src/api/another_fake_api.e +++ b/samples/client/petstore/eiffel/src/api/another_fake_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - test_special_tags (client: CLIENT): detachable CLIENT - -- To test special tags + 123_test_special_tags (body: CLIENT): detachable CLIENT -- To test special tags + -- To test special tags and operation ID starting with number -- - -- argument: client client model (required) + -- argument: body client model (required) -- -- -- Result CLIENT @@ -40,7 +40,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(client) + l_request.set_body(body) l_path := "/another-fake/dummy" diff --git a/samples/client/petstore/eiffel/src/api/fake_api.e b/samples/client/petstore/eiffel/src/api/fake_api.e index 6e7a054c2bdc..05cd7a9c5031 100644 --- a/samples/client/petstore/eiffel/src/api/fake_api.e +++ b/samples/client/petstore/eiffel/src/api/fake_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,6 +24,36 @@ inherit feature -- API Access + create_xml_item (xml_item: XML_ITEM) + -- creates an XmlItem + -- this route creates an XmlItem + -- + -- argument: xml_item XmlItem Body (required) + -- + -- + require + local + l_path: STRING + l_request: API_CLIENT_REQUEST + l_response: API_CLIENT_RESPONSE + do + reset_error + create l_request + l_request.set_body(xml_item) + l_path := "/fake/create_xml_item" + + + if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then + l_request.add_header(l_accept,"Accept"); + end + l_request.add_header(api_client.select_header_content_type (<<"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16">>),"Content-Type") + l_request.set_auth_names (<<>>) + l_response := api_client.call_api (l_path, "Post", l_request, agent serializer, Void) + if l_response.has_error then + last_error := l_response.error + end + end + fake_outer_boolean_serialize (body: BOOLEAN): detachable BOOLEAN -- -- Test serialization of outer boolean types @@ -59,11 +89,11 @@ feature -- API Access end end - fake_outer_composite_serialize (outer_composite: detachable OUTER_COMPOSITE): detachable OUTER_COMPOSITE + fake_outer_composite_serialize (body: detachable OUTER_COMPOSITE): detachable OUTER_COMPOSITE -- -- Test serialization of object with outer number type -- - -- argument: outer_composite Input composite as post body (optional) + -- argument: body Input composite as post body (optional) -- -- -- Result OUTER_COMPOSITE @@ -75,7 +105,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(outer_composite) + l_request.set_body(body) l_path := "/fake/outer/composite" @@ -164,13 +194,43 @@ feature -- API Access end end - test_body_with_query_params (query: STRING_32; user: USER) + test_body_with_file_schema (body: FILE_SCHEMA_TEST_CLASS) + -- + -- For this test, the body for this request much reference a schema named `File`. + -- + -- argument: body (required) + -- + -- + require + local + l_path: STRING + l_request: API_CLIENT_REQUEST + l_response: API_CLIENT_RESPONSE + do + reset_error + create l_request + l_request.set_body(body) + l_path := "/fake/body-with-file-schema" + + + if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then + l_request.add_header(l_accept,"Accept"); + end + l_request.add_header(api_client.select_header_content_type (<<"application/json">>),"Content-Type") + l_request.set_auth_names (<<>>) + l_response := api_client.call_api (l_path, "Put", l_request, agent serializer, Void) + if l_response.has_error then + last_error := l_response.error + end + end + + test_body_with_query_params (query: STRING_32; body: USER) -- -- -- -- argument: query (required) -- - -- argument: user (required) + -- argument: body (required) -- -- require @@ -181,7 +241,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/fake/body-with-query-params" l_request.fill_query_params(api_client.parameter_to_tuple("", "query", query)); @@ -197,11 +257,11 @@ feature -- API Access end end - test_client_model (client: CLIENT): detachable CLIENT + test_client_model (body: CLIENT): detachable CLIENT -- To test \"client\" model -- To test \"client\" model -- - -- argument: client client model (required) + -- argument: body client model (required) -- -- -- Result CLIENT @@ -213,7 +273,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(client) + l_request.set_body(body) l_path := "/fake" @@ -232,9 +292,9 @@ feature -- API Access end end - test_endpoint_parameters (number: REAL_32; double: REAL_64; pattern_without_delimiter: STRING_32; byte: ARRAY [NATURAL_8]; integer: INTEGER_32; int32: INTEGER_32; int64: INTEGER_64; float: REAL_32; string: STRING_32; binary: FILE; date: DATE; date_time: DATE_TIME; password: STRING_32; callback: STRING_32) - -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + test_endpoint_parameters (number: REAL_32; double: REAL_64; pattern_without_delimiter: STRING_32; byte: ARRAY [NATURAL_8]; integer: INTEGER_32; int32: INTEGER_32; int64: INTEGER_64; float: REAL_32; string: STRING_32; binary: FILE; date: DATE; date_time: DATE_TIME; password: STRING; callback: STRING_32) + -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -- -- argument: number None (required) -- @@ -339,21 +399,21 @@ feature -- API Access end end - test_enum_parameters (enum_header_string_array: detachable LIST [STRING_32]; enum_header_string: STRING_32; enum_query_string_array: detachable LIST [STRING_32]; enum_query_string: STRING_32; enum_query_integer: INTEGER_32; enum_query_double: REAL_64; enum_form_string_array: LIST [STRING_32]; enum_form_string: STRING_32) + test_enum_parameters (enum_header_string_array: detachable LIST [STRING_32]; enum_header_string: STRING_32; enum_query_string_array: detachable LIST [STRING_32]; enum_query_string: STRING_32; enum_query_integer: INTEGER_32; enum_query_double: REAL_64; enum_form_string_array: detachable LIST [STRING_32]; enum_form_string: STRING_32) -- To test enum parameters -- To test enum parameters -- - -- argument: enum_header_string_array Header parameter enum test (string array) (optional) + -- argument: enum_header_string_array Header parameter enum test (string array) (optional, default to null) -- -- argument: enum_header_string Header parameter enum test (string) (optional, default to -efg) -- - -- argument: enum_query_string_array Query parameter enum test (string array) (optional) + -- argument: enum_query_string_array Query parameter enum test (string array) (optional, default to null) -- -- argument: enum_query_string Query parameter enum test (string) (optional, default to -efg) -- - -- argument: enum_query_integer Query parameter enum test (double) (optional) + -- argument: enum_query_integer Query parameter enum test (double) (optional, default to null) -- - -- argument: enum_query_double Query parameter enum test (double) (optional) + -- argument: enum_query_double Query parameter enum test (double) (optional, default to null) -- -- argument: enum_form_string_array Form parameter enum test (string array) (optional, default to $) -- @@ -399,11 +459,61 @@ feature -- API Access end end - test_inline_additional_properties (request_body: STRING_TABLE[STRING_32]) + test_group_parameters (required_string_group: INTEGER_32; required_boolean_group: BOOLEAN; required_int64_group: INTEGER_64; string_group: INTEGER_32; boolean_group: BOOLEAN; int64_group: INTEGER_64) + -- Fake endpoint to test group parameters (optional) + -- Fake endpoint to test group parameters (optional) + -- + -- argument: required_string_group Required String in group parameters (required) + -- + -- argument: required_boolean_group Required Boolean in group parameters (required) + -- + -- argument: required_int64_group Required Integer in group parameters (required) + -- + -- argument: string_group String in group parameters (optional, default to null) + -- + -- argument: boolean_group Boolean in group parameters (optional, default to null) + -- + -- argument: int64_group Integer in group parameters (optional, default to null) + -- + -- + require + local + l_path: STRING + l_request: API_CLIENT_REQUEST + l_response: API_CLIENT_RESPONSE + do + reset_error + create l_request + + l_path := "/fake" + l_request.fill_query_params(api_client.parameter_to_tuple("", "required_string_group", required_string_group)); + l_request.fill_query_params(api_client.parameter_to_tuple("", "required_int64_group", required_int64_group)); + l_request.fill_query_params(api_client.parameter_to_tuple("", "string_group", string_group)); + l_request.fill_query_params(api_client.parameter_to_tuple("", "int64_group", int64_group)); + + if attached required_boolean_group as l_required_boolean_group then + l_request.add_header(l_required_boolean_group.out,"required_boolean_group"); + end + if attached boolean_group as l_boolean_group then + l_request.add_header(l_boolean_group.out,"boolean_group"); + end + + if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then + l_request.add_header(l_accept,"Accept"); + end + l_request.add_header(api_client.select_header_content_type (<<>>),"Content-Type") + l_request.set_auth_names (<<>>) + l_response := api_client.call_api (l_path, "Delete", l_request, agent serializer, Void) + if l_response.has_error then + last_error := l_response.error + end + end + + test_inline_additional_properties (param: STRING_TABLE[STRING_32]) -- test inline additionalProperties -- -- - -- argument: request_body request body (required) + -- argument: param request body (required) -- -- require @@ -414,7 +524,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(request_body) + l_request.set_body(param) l_path := "/fake/inline-additionalProperties" @@ -467,5 +577,48 @@ feature -- API Access end end + test_query_parameter_collection_format (pipe: LIST [STRING_32]; ioutil: LIST [STRING_32]; http: LIST [STRING_32]; url: LIST [STRING_32]; context: LIST [STRING_32]) + -- + -- To test the collection format in query parameters + -- + -- argument: pipe (required) + -- + -- argument: ioutil (required) + -- + -- argument: http (required) + -- + -- argument: url (required) + -- + -- argument: context (required) + -- + -- + require + local + l_path: STRING + l_request: API_CLIENT_REQUEST + l_response: API_CLIENT_RESPONSE + do + reset_error + create l_request + + l_path := "/fake/test-query-paramters" + l_request.fill_query_params(api_client.parameter_to_tuple("csv", "pipe", pipe)); + l_request.fill_query_params(api_client.parameter_to_tuple("csv", "ioutil", ioutil)); + l_request.fill_query_params(api_client.parameter_to_tuple("ssv", "http", http)); + l_request.fill_query_params(api_client.parameter_to_tuple("csv", "url", url)); + l_request.fill_query_params(api_client.parameter_to_tuple("multi", "context", context)); + + + if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then + l_request.add_header(l_accept,"Accept"); + end + l_request.add_header(api_client.select_header_content_type (<<>>),"Content-Type") + l_request.set_auth_names (<<>>) + l_response := api_client.call_api (l_path, "Put", l_request, agent serializer, Void) + if l_response.has_error then + last_error := l_response.error + end + end + end diff --git a/samples/client/petstore/eiffel/src/api/fake_classname_tags123_api.e b/samples/client/petstore/eiffel/src/api/fake_classname_tags123_api.e index de7f29df8af5..51544cb912f5 100644 --- a/samples/client/petstore/eiffel/src/api/fake_classname_tags123_api.e +++ b/samples/client/petstore/eiffel/src/api/fake_classname_tags123_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - test_classname (client: CLIENT): detachable CLIENT + test_classname (body: CLIENT): detachable CLIENT -- To test class name in snake case -- To test class name in snake case -- - -- argument: client client model (required) + -- argument: body client model (required) -- -- -- Result CLIENT @@ -40,7 +40,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(client) + l_request.set_body(body) l_path := "/fake_classname_test" diff --git a/samples/client/petstore/eiffel/src/api/pet_api.e b/samples/client/petstore/eiffel/src/api/pet_api.e index 17a482737ed5..9d0a9967dfd4 100644 --- a/samples/client/petstore/eiffel/src/api/pet_api.e +++ b/samples/client/petstore/eiffel/src/api/pet_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - add_pet (pet: PET) + add_pet (body: PET) -- Add a new pet to the store -- -- - -- argument: pet Pet object that needs to be added to the store (required) + -- argument: body Pet object that needs to be added to the store (required) -- -- require @@ -39,7 +39,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(pet) + l_request.set_body(body) l_path := "/pet" @@ -60,7 +60,7 @@ feature -- API Access -- -- argument: pet_id Pet id to delete (required) -- - -- argument: api_key (optional) + -- argument: api_key (optional, default to null) -- -- require @@ -198,11 +198,11 @@ feature -- API Access end end - update_pet (pet: PET) + update_pet (body: PET) -- Update an existing pet -- -- - -- argument: pet Pet object that needs to be added to the store (required) + -- argument: body Pet object that needs to be added to the store (required) -- -- require @@ -213,7 +213,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(pet) + l_request.set_body(body) l_path := "/pet" @@ -315,5 +315,51 @@ feature -- API Access end end + upload_file_with_required_file (pet_id: INTEGER_64; required_file: FILE; additional_metadata: STRING_32): detachable API_RESPONSE + -- uploads an image (required) + -- + -- + -- argument: pet_id ID of pet to update (required) + -- + -- argument: required_file file to upload (required) + -- + -- argument: additional_metadata Additional data to pass to server (optional, default to null) + -- + -- + -- Result API_RESPONSE + require + local + l_path: STRING + l_request: API_CLIENT_REQUEST + l_response: API_CLIENT_RESPONSE + do + reset_error + create l_request + + l_path := "/fake/{petId}/uploadImageWithRequiredFile" + l_path.replace_substring_all ("{"+"petId"+"}", api_client.url_encode (pet_id.out)) + + if attached additional_metadata as l_additional_metadata then + l_request.add_form(l_additional_metadata,"additionalMetadata"); + end + if attached required_file as l_required_file then + l_request.add_form(l_required_file,"requiredFile"); + end + + if attached {STRING} api_client.select_header_accept (<<"application/json">>) as l_accept then + l_request.add_header(l_accept,"Accept"); + end + l_request.add_header(api_client.select_header_content_type (<<"multipart/form-data">>),"Content-Type") + l_request.set_auth_names (<<"petstore_auth">>) + l_response := api_client.call_api (l_path, "Post", l_request, Void, agent deserializer) + if l_response.has_error then + last_error := l_response.error + elseif attached { API_RESPONSE } l_response.data ({ API_RESPONSE }) as l_data then + Result := l_data + else + create last_error.make ("Unknown error: Status response [ " + l_response.status.out + "]") + end + end + end diff --git a/samples/client/petstore/eiffel/src/api/store_api.e b/samples/client/petstore/eiffel/src/api/store_api.e index 2f0854b3b391..d5d4177baae0 100644 --- a/samples/client/petstore/eiffel/src/api/store_api.e +++ b/samples/client/petstore/eiffel/src/api/store_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -126,11 +126,11 @@ feature -- API Access end end - place_order (order: ORDER): detachable ORDER + place_order (body: ORDER): detachable ORDER -- Place an order for a pet -- -- - -- argument: order order placed for purchasing the pet (required) + -- argument: body order placed for purchasing the pet (required) -- -- -- Result ORDER @@ -142,7 +142,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(order) + l_request.set_body(body) l_path := "/store/order" diff --git a/samples/client/petstore/eiffel/src/api/user_api.e b/samples/client/petstore/eiffel/src/api/user_api.e index 3b5703b40cfb..7e64a8fa4373 100644 --- a/samples/client/petstore/eiffel/src/api/user_api.e +++ b/samples/client/petstore/eiffel/src/api/user_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - create_user (user: USER) + create_user (body: USER) -- Create user -- This can only be done by the logged in user. -- - -- argument: user Created user object (required) + -- argument: body Created user object (required) -- -- require @@ -39,7 +39,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/user" @@ -54,11 +54,11 @@ feature -- API Access end end - create_users_with_array_input (user: LIST [USER]) + create_users_with_array_input (body: LIST [USER]) -- Creates list of users with given input array -- -- - -- argument: user List of user object (required) + -- argument: body List of user object (required) -- -- require @@ -69,7 +69,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/user/createWithArray" @@ -84,11 +84,11 @@ feature -- API Access end end - create_users_with_list_input (user: LIST [USER]) + create_users_with_list_input (body: LIST [USER]) -- Creates list of users with given input array -- -- - -- argument: user List of user object (required) + -- argument: body List of user object (required) -- -- require @@ -99,7 +99,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/user/createWithList" @@ -212,13 +212,13 @@ feature -- API Access end end - update_user (username: STRING_32; user: USER) + update_user (username: STRING_32; body: USER) -- Updated user -- This can only be done by the logged in user. -- -- argument: username name that need to be deleted (required) -- - -- argument: user Updated user object (required) + -- argument: body Updated user object (required) -- -- require @@ -229,7 +229,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(user) + l_request.set_body(body) l_path := "/user/{username}" l_path.replace_substring_all ("{"+"username"+"}", api_client.url_encode (username.out)) diff --git a/samples/client/petstore/eiffel/src/api_client.e b/samples/client/petstore/eiffel/src/api_client.e index 6397c4293d65..47b5fba938b8 100644 --- a/samples/client/petstore/eiffel/src/api_client.e +++ b/samples/client/petstore/eiffel/src/api_client.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/additional_properties_class.e b/samples/client/petstore/eiffel/src/domain/additional_properties_class.e index f11b85fd0073..8e0af3ebc2c8 100644 --- a/samples/client/petstore/eiffel/src/domain/additional_properties_class.e +++ b/samples/client/petstore/eiffel/src/domain/additional_properties_class.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,27 +24,117 @@ inherit feature --Access - map_property: detachable STRING_TABLE[STRING_32] + map_string: detachable STRING_TABLE[STRING_32] - map_of_map_property: detachable STRING_TABLE[STRING_TABLE[STRING_32]] + map_number: STRING_TABLE[REAL_32] + + map_integer: STRING_TABLE[INTEGER_32] + + map_boolean: STRING_TABLE[BOOLEAN] + + map_array_integer: detachable STRING_TABLE[LIST [INTEGER_32]] + + map_array_anytype: detachable STRING_TABLE[LIST [ANY]] + + map_map_string: detachable STRING_TABLE[STRING_TABLE[STRING_32]] + + map_map_anytype: detachable STRING_TABLE[STRING_TABLE[ANY]] + + anytype_1: detachable ANY + + anytype_2: detachable ANY + + anytype_3: detachable ANY feature -- Change Element - set_map_property (a_name: like map_property) - -- Set 'map_property' with 'a_name'. + set_map_string (a_name: like map_string) + -- Set 'map_string' with 'a_name'. + do + map_string := a_name + ensure + map_string_set: map_string = a_name + end + + set_map_number (a_name: like map_number) + -- Set 'map_number' with 'a_name'. + do + map_number := a_name + ensure + map_number_set: map_number = a_name + end + + set_map_integer (a_name: like map_integer) + -- Set 'map_integer' with 'a_name'. + do + map_integer := a_name + ensure + map_integer_set: map_integer = a_name + end + + set_map_boolean (a_name: like map_boolean) + -- Set 'map_boolean' with 'a_name'. + do + map_boolean := a_name + ensure + map_boolean_set: map_boolean = a_name + end + + set_map_array_integer (a_name: like map_array_integer) + -- Set 'map_array_integer' with 'a_name'. do - map_property := a_name + map_array_integer := a_name ensure - map_property_set: map_property = a_name + map_array_integer_set: map_array_integer = a_name end - set_map_of_map_property (a_name: like map_of_map_property) - -- Set 'map_of_map_property' with 'a_name'. + set_map_array_anytype (a_name: like map_array_anytype) + -- Set 'map_array_anytype' with 'a_name'. do - map_of_map_property := a_name + map_array_anytype := a_name ensure - map_of_map_property_set: map_of_map_property = a_name + map_array_anytype_set: map_array_anytype = a_name + end + + set_map_map_string (a_name: like map_map_string) + -- Set 'map_map_string' with 'a_name'. + do + map_map_string := a_name + ensure + map_map_string_set: map_map_string = a_name + end + + set_map_map_anytype (a_name: like map_map_anytype) + -- Set 'map_map_anytype' with 'a_name'. + do + map_map_anytype := a_name + ensure + map_map_anytype_set: map_map_anytype = a_name + end + + set_anytype_1 (a_name: like anytype_1) + -- Set 'anytype_1' with 'a_name'. + do + anytype_1 := a_name + ensure + anytype_1_set: anytype_1 = a_name + end + + set_anytype_2 (a_name: like anytype_2) + -- Set 'anytype_2' with 'a_name'. + do + anytype_2 := a_name + ensure + anytype_2_set: anytype_2 = a_name + end + + set_anytype_3 (a_name: like anytype_3) + -- Set 'anytype_3' with 'a_name'. + do + anytype_3 := a_name + ensure + anytype_3_set: anytype_3 = a_name end @@ -55,9 +145,81 @@ feature -- Change Element do create Result.make_empty Result.append("%Nclass ADDITIONAL_PROPERTIES_CLASS%N") - if attached map_property as l_map_property then - Result.append ("%Nmap_property:") - across l_map_property as ic loop + if attached map_string as l_map_string then + Result.append ("%Nmap_string:") + across l_map_string as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached map_number as l_map_number then + Result.append ("%Nmap_number:") + across l_map_number as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached map_integer as l_map_integer then + Result.append ("%Nmap_integer:") + across l_map_integer as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached map_boolean as l_map_boolean then + Result.append ("%Nmap_boolean:") + across l_map_boolean as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached map_array_integer as l_map_array_integer then + Result.append ("%Nmap_array_integer:") + across l_map_array_integer as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached map_array_anytype as l_map_array_anytype then + Result.append ("%Nmap_array_anytype:") + across l_map_array_anytype as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached map_map_string as l_map_map_string then + Result.append ("%Nmap_map_string:") + across l_map_map_string as ic loop Result.append ("%N") Result.append ("key:") Result.append (ic.key.out) @@ -67,9 +229,9 @@ feature -- Change Element Result.append ("%N") end end - if attached map_of_map_property as l_map_of_map_property then - Result.append ("%Nmap_of_map_property:") - across l_map_of_map_property as ic loop + if attached map_map_anytype as l_map_map_anytype then + Result.append ("%Nmap_map_anytype:") + across l_map_map_anytype as ic loop Result.append ("%N") Result.append ("key:") Result.append (ic.key.out) @@ -79,6 +241,21 @@ feature -- Change Element Result.append ("%N") end end + if attached anytype_1 as l_anytype_1 then + Result.append ("%Nanytype_1:") + Result.append (l_anytype_1.out) + Result.append ("%N") + end + if attached anytype_2 as l_anytype_2 then + Result.append ("%Nanytype_2:") + Result.append (l_anytype_2.out) + Result.append ("%N") + end + if attached anytype_3 as l_anytype_3 then + Result.append ("%Nanytype_3:") + Result.append (l_anytype_3.out) + Result.append ("%N") + end end end diff --git a/samples/client/petstore/eiffel/src/domain/animal.e b/samples/client/petstore/eiffel/src/domain/animal.e index 72fa473c5a0e..4d5f28f87198 100644 --- a/samples/client/petstore/eiffel/src/domain/animal.e +++ b/samples/client/petstore/eiffel/src/domain/animal.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/api_response.e b/samples/client/petstore/eiffel/src/domain/api_response.e index 8b3e64ff0467..a88da23e821a 100644 --- a/samples/client/petstore/eiffel/src/domain/api_response.e +++ b/samples/client/petstore/eiffel/src/domain/api_response.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/array_of_array_of_number_only.e b/samples/client/petstore/eiffel/src/domain/array_of_array_of_number_only.e index b261e583d68a..f0d431208be3 100644 --- a/samples/client/petstore/eiffel/src/domain/array_of_array_of_number_only.e +++ b/samples/client/petstore/eiffel/src/domain/array_of_array_of_number_only.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/array_of_number_only.e b/samples/client/petstore/eiffel/src/domain/array_of_number_only.e index 5a37891c5002..611adaf481e9 100644 --- a/samples/client/petstore/eiffel/src/domain/array_of_number_only.e +++ b/samples/client/petstore/eiffel/src/domain/array_of_number_only.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/array_test.e b/samples/client/petstore/eiffel/src/domain/array_test.e index a0c54fcf6feb..7a8d26ad4d40 100644 --- a/samples/client/petstore/eiffel/src/domain/array_test.e +++ b/samples/client/petstore/eiffel/src/domain/array_test.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/capitalization.e b/samples/client/petstore/eiffel/src/domain/capitalization.e index b5b4c5b238a4..04eb0f9fbe21 100644 --- a/samples/client/petstore/eiffel/src/domain/capitalization.e +++ b/samples/client/petstore/eiffel/src/domain/capitalization.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/cat.e b/samples/client/petstore/eiffel/src/domain/cat.e index c041e4d8db55..2dd7e4d5149f 100644 --- a/samples/client/petstore/eiffel/src/domain/cat.e +++ b/samples/client/petstore/eiffel/src/domain/cat.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/category.e b/samples/client/petstore/eiffel/src/domain/category.e index 8bd714c7261c..73b059252de8 100644 --- a/samples/client/petstore/eiffel/src/domain/category.e +++ b/samples/client/petstore/eiffel/src/domain/category.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/class_model.e b/samples/client/petstore/eiffel/src/domain/class_model.e index 711a9a568445..fb1f96792972 100644 --- a/samples/client/petstore/eiffel/src/domain/class_model.e +++ b/samples/client/petstore/eiffel/src/domain/class_model.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/client.e b/samples/client/petstore/eiffel/src/domain/client.e index 666e391e516c..dad51e110e55 100644 --- a/samples/client/petstore/eiffel/src/domain/client.e +++ b/samples/client/petstore/eiffel/src/domain/client.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/dog.e b/samples/client/petstore/eiffel/src/domain/dog.e index 120d8b86f9c3..5cd110fe11d3 100644 --- a/samples/client/petstore/eiffel/src/domain/dog.e +++ b/samples/client/petstore/eiffel/src/domain/dog.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/enum_arrays.e b/samples/client/petstore/eiffel/src/domain/enum_arrays.e index ddb0fd5594b2..7f3348347519 100644 --- a/samples/client/petstore/eiffel/src/domain/enum_arrays.e +++ b/samples/client/petstore/eiffel/src/domain/enum_arrays.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/enum_class.e b/samples/client/petstore/eiffel/src/domain/enum_class.e index 79a0e952b2f4..2b37b2f8ff50 100644 --- a/samples/client/petstore/eiffel/src/domain/enum_class.e +++ b/samples/client/petstore/eiffel/src/domain/enum_class.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/enum_test.e b/samples/client/petstore/eiffel/src/domain/enum_test.e index 87cf363f7015..273e2eb89580 100644 --- a/samples/client/petstore/eiffel/src/domain/enum_test.e +++ b/samples/client/petstore/eiffel/src/domain/enum_test.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/format_test.e b/samples/client/petstore/eiffel/src/domain/format_test.e index 52d9167188f3..67df5623e52b 100644 --- a/samples/client/petstore/eiffel/src/domain/format_test.e +++ b/samples/client/petstore/eiffel/src/domain/format_test.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -48,7 +48,9 @@ feature --Access uuid: detachable UUID - password: detachable STRING_32 + password: detachable STRING + + big_decimal: detachable BIG_DECIMAL feature -- Change Element @@ -157,6 +159,14 @@ feature -- Change Element password_set: password = a_name end + set_big_decimal (a_name: like big_decimal) + -- Set 'big_decimal' with 'a_name'. + do + big_decimal := a_name + ensure + big_decimal_set: big_decimal = a_name + end + feature -- Status Report @@ -230,6 +240,11 @@ feature -- Change Element Result.append (l_password.out) Result.append ("%N") end + if attached big_decimal as l_big_decimal then + Result.append ("%Nbig_decimal:") + Result.append (l_big_decimal.out) + Result.append ("%N") + end end end diff --git a/samples/client/petstore/eiffel/src/domain/has_only_read_only.e b/samples/client/petstore/eiffel/src/domain/has_only_read_only.e index 27cf1ba49d0e..80a9b8a78cc5 100644 --- a/samples/client/petstore/eiffel/src/domain/has_only_read_only.e +++ b/samples/client/petstore/eiffel/src/domain/has_only_read_only.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/map_test.e b/samples/client/petstore/eiffel/src/domain/map_test.e index 0e7cf934f014..62eb65c6e0c6 100644 --- a/samples/client/petstore/eiffel/src/domain/map_test.e +++ b/samples/client/petstore/eiffel/src/domain/map_test.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,6 +28,10 @@ feature --Access map_of_enum_string: detachable STRING_TABLE[STRING_32] + direct_map: STRING_TABLE[BOOLEAN] + + indirect_map: STRING_TABLE[BOOLEAN] + feature -- Change Element @@ -47,6 +51,22 @@ feature -- Change Element map_of_enum_string_set: map_of_enum_string = a_name end + set_direct_map (a_name: like direct_map) + -- Set 'direct_map' with 'a_name'. + do + direct_map := a_name + ensure + direct_map_set: direct_map = a_name + end + + set_indirect_map (a_name: like indirect_map) + -- Set 'indirect_map' with 'a_name'. + do + indirect_map := a_name + ensure + indirect_map_set: indirect_map = a_name + end + feature -- Status Report @@ -79,6 +99,30 @@ feature -- Change Element Result.append ("%N") end end + if attached direct_map as l_direct_map then + Result.append ("%Ndirect_map:") + across l_direct_map as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end + if attached indirect_map as l_indirect_map then + Result.append ("%Nindirect_map:") + across l_indirect_map as ic loop + Result.append ("%N") + Result.append ("key:") + Result.append (ic.key.out) + Result.append (" - ") + Result.append ("val:") + Result.append (ic.item.out) + Result.append ("%N") + end + end end end diff --git a/samples/client/petstore/eiffel/src/domain/mixed_properties_and_additional_properties_class.e b/samples/client/petstore/eiffel/src/domain/mixed_properties_and_additional_properties_class.e index 2bb76decc071..0f0880fc5210 100644 --- a/samples/client/petstore/eiffel/src/domain/mixed_properties_and_additional_properties_class.e +++ b/samples/client/petstore/eiffel/src/domain/mixed_properties_and_additional_properties_class.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/model_200_response.e b/samples/client/petstore/eiffel/src/domain/model_200_response.e index a365d406b58e..3228375b48d2 100644 --- a/samples/client/petstore/eiffel/src/domain/model_200_response.e +++ b/samples/client/petstore/eiffel/src/domain/model_200_response.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/name.e b/samples/client/petstore/eiffel/src/domain/name.e index 2d1c49cc0635..7ec27b4217a4 100644 --- a/samples/client/petstore/eiffel/src/domain/name.e +++ b/samples/client/petstore/eiffel/src/domain/name.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/number_only.e b/samples/client/petstore/eiffel/src/domain/number_only.e index 270cbcbea3c3..f761185c0cff 100644 --- a/samples/client/petstore/eiffel/src/domain/number_only.e +++ b/samples/client/petstore/eiffel/src/domain/number_only.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/order.e b/samples/client/petstore/eiffel/src/domain/order.e index 0da3b9349f94..b30db500ae5c 100644 --- a/samples/client/petstore/eiffel/src/domain/order.e +++ b/samples/client/petstore/eiffel/src/domain/order.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/outer_composite.e b/samples/client/petstore/eiffel/src/domain/outer_composite.e index 845476ed1513..986125f5941b 100644 --- a/samples/client/petstore/eiffel/src/domain/outer_composite.e +++ b/samples/client/petstore/eiffel/src/domain/outer_composite.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/outer_enum.e b/samples/client/petstore/eiffel/src/domain/outer_enum.e index c88e2c561a0e..6e93a0d41dc3 100644 --- a/samples/client/petstore/eiffel/src/domain/outer_enum.e +++ b/samples/client/petstore/eiffel/src/domain/outer_enum.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/pet.e b/samples/client/petstore/eiffel/src/domain/pet.e index 86d845c22e87..71c6620625c4 100644 --- a/samples/client/petstore/eiffel/src/domain/pet.e +++ b/samples/client/petstore/eiffel/src/domain/pet.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/read_only_first.e b/samples/client/petstore/eiffel/src/domain/read_only_first.e index 65d41d07fac4..278a836905cc 100644 --- a/samples/client/petstore/eiffel/src/domain/read_only_first.e +++ b/samples/client/petstore/eiffel/src/domain/read_only_first.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/return.e b/samples/client/petstore/eiffel/src/domain/return.e index 2e08c0f53d9f..063c921c6cd0 100644 --- a/samples/client/petstore/eiffel/src/domain/return.e +++ b/samples/client/petstore/eiffel/src/domain/return.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/special_model_name.e b/samples/client/petstore/eiffel/src/domain/special_model_name.e index 90e30e783f20..15c4b7f45126 100644 --- a/samples/client/petstore/eiffel/src/domain/special_model_name.e +++ b/samples/client/petstore/eiffel/src/domain/special_model_name.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/tag.e b/samples/client/petstore/eiffel/src/domain/tag.e index f62729bed5d2..61bf5592c1c0 100644 --- a/samples/client/petstore/eiffel/src/domain/tag.e +++ b/samples/client/petstore/eiffel/src/domain/tag.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/user.e b/samples/client/petstore/eiffel/src/domain/user.e index 07586c1b55d1..5848fc7ca2bd 100644 --- a/samples/client/petstore/eiffel/src/domain/user.e +++ b/samples/client/petstore/eiffel/src/domain/user.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_client_request.e b/samples/client/petstore/eiffel/src/framework/api_client_request.e index fcd2a09d1411..816e717e611c 100644 --- a/samples/client/petstore/eiffel/src/framework/api_client_request.e +++ b/samples/client/petstore/eiffel/src/framework/api_client_request.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_client_response.e b/samples/client/petstore/eiffel/src/framework/api_client_response.e index cf0978b25797..c17c730f541a 100644 --- a/samples/client/petstore/eiffel/src/framework/api_client_response.e +++ b/samples/client/petstore/eiffel/src/framework/api_client_response.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_error.e b/samples/client/petstore/eiffel/src/framework/api_error.e index ca89aae7f7a7..69871d5261c8 100644 --- a/samples/client/petstore/eiffel/src/framework/api_error.e +++ b/samples/client/petstore/eiffel/src/framework/api_error.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_i.e b/samples/client/petstore/eiffel/src/framework/api_i.e index ca0a45cd41c4..019e0f9c89ee 100644 --- a/samples/client/petstore/eiffel/src/framework/api_i.e +++ b/samples/client/petstore/eiffel/src/framework/api_i.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e b/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e index 4087386d6013..2bf9a468b0a9 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/authentication.e b/samples/client/petstore/eiffel/src/framework/auth/authentication.e index b53248ae6e3f..3ce3085eccfa 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/authentication.e +++ b/samples/client/petstore/eiffel/src/framework/auth/authentication.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e b/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e index 3fd7664bcec1..3c26a645cb53 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/oauth.e b/samples/client/petstore/eiffel/src/framework/auth/oauth.e index 66b4ba5c3c5f..f8898302f87b 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/oauth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/oauth.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/configuration.e b/samples/client/petstore/eiffel/src/framework/configuration.e index 3b9fe5e834e6..1ede7bf95840 100644 --- a/samples/client/petstore/eiffel/src/framework/configuration.e +++ b/samples/client/petstore/eiffel/src/framework/configuration.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e index 22f065ace998..8f83f763c740 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e index 993decf6a2c2..dd5f91d56bfd 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ expanded class feature -- Access from_json (a_val:STRING; a_type: TYPE [detachable ANY] ): detachable ANY - -- Deserialize a a json representation `a_val' to an object + -- Deserialize a json representation `a_val' to an object -- of type `a_type' local conv_from: JSON_BASIC_REFLECTOR_DESERIALIZER diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e index b7a144f70181..3bbb064f8f80 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e index db5d96af069b..46326c768317 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/test/api_test.ecf b/samples/client/petstore/eiffel/test/api_test.ecf index ddb5082cabec..d1395a07c57c 100644 --- a/samples/client/petstore/eiffel/test/api_test.ecf +++ b/samples/client/petstore/eiffel/test/api_test.ecf @@ -1,5 +1,5 @@ - + diff --git a/samples/client/petstore/erlang-client/.openapi-generator/VERSION b/samples/client/petstore/erlang-client/.openapi-generator/VERSION index 105bb87d77b3..bfbf77eb7fad 100644 --- a/samples/client/petstore/erlang-client/.openapi-generator/VERSION +++ b/samples/client/petstore/erlang-client/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.2-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-client/src/petstore_pet_api.erl b/samples/client/petstore/erlang-client/src/petstore_pet_api.erl index bbb664f66bda..d46e57785f3a 100644 --- a/samples/client/petstore/erlang-client/src/petstore_pet_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_pet_api.erl @@ -14,11 +14,11 @@ %% @doc Add a new pet to the store %% -spec add_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -add_pet(Ctx, PetstorePet) -> - add_pet(Ctx, PetstorePet, #{}). +add_pet(Ctx, Body) -> + add_pet(Ctx, Body, #{}). -spec add_pet(ctx:ctx(), petstore_pet:petstore_pet(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -add_pet(Ctx, PetstorePet, Optional) -> +add_pet(Ctx, Body, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -26,7 +26,7 @@ add_pet(Ctx, PetstorePet, Optional) -> Path = ["/pet"], QS = [], Headers = [], - Body1 = PetstorePet, + Body1 = Body, ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>, <<"application/xml">>]), Opts = maps:get(hackney_opts, Optional, []), @@ -119,11 +119,11 @@ get_pet_by_id(Ctx, PetId, Optional) -> %% @doc Update an existing pet %% -spec update_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -update_pet(Ctx, PetstorePet) -> - update_pet(Ctx, PetstorePet, #{}). +update_pet(Ctx, Body) -> + update_pet(Ctx, Body, #{}). -spec update_pet(ctx:ctx(), petstore_pet:petstore_pet(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -update_pet(Ctx, PetstorePet, Optional) -> +update_pet(Ctx, Body, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -131,7 +131,7 @@ update_pet(Ctx, PetstorePet, Optional) -> Path = ["/pet"], QS = [], Headers = [], - Body1 = PetstorePet, + Body1 = Body, ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>, <<"application/xml">>]), Opts = maps:get(hackney_opts, Optional, []), diff --git a/samples/client/petstore/erlang-client/src/petstore_store_api.erl b/samples/client/petstore/erlang-client/src/petstore_store_api.erl index 178cd0a2cb23..cf579f116457 100644 --- a/samples/client/petstore/erlang-client/src/petstore_store_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_store_api.erl @@ -73,11 +73,11 @@ get_order_by_id(Ctx, OrderId, Optional) -> %% @doc Place an order for a pet %% -spec place_order(ctx:ctx(), petstore_order:petstore_order()) -> {ok, petstore_order:petstore_order(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -place_order(Ctx, PetstoreOrder) -> - place_order(Ctx, PetstoreOrder, #{}). +place_order(Ctx, Body) -> + place_order(Ctx, Body, #{}). -spec place_order(ctx:ctx(), petstore_order:petstore_order(), maps:map()) -> {ok, petstore_order:petstore_order(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -place_order(Ctx, PetstoreOrder, Optional) -> +place_order(Ctx, Body, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -85,7 +85,7 @@ place_order(Ctx, PetstoreOrder, Optional) -> Path = ["/store/order"], QS = [], Headers = [], - Body1 = PetstoreOrder, + Body1 = Body, ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), diff --git a/samples/client/petstore/erlang-client/src/petstore_user_api.erl b/samples/client/petstore/erlang-client/src/petstore_user_api.erl index b1f07026be88..dd44acddd965 100644 --- a/samples/client/petstore/erlang-client/src/petstore_user_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_user_api.erl @@ -14,11 +14,11 @@ %% @doc Create user %% This can only be done by the logged in user. -spec create_user(ctx:ctx(), petstore_user:petstore_user()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -create_user(Ctx, PetstoreUser) -> - create_user(Ctx, PetstoreUser, #{}). +create_user(Ctx, Body) -> + create_user(Ctx, Body, #{}). -spec create_user(ctx:ctx(), petstore_user:petstore_user(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -create_user(Ctx, PetstoreUser, Optional) -> +create_user(Ctx, Body, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -26,7 +26,7 @@ create_user(Ctx, PetstoreUser, Optional) -> Path = ["/user"], QS = [], Headers = [], - Body1 = PetstoreUser, + Body1 = Body, ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), @@ -35,11 +35,11 @@ create_user(Ctx, PetstoreUser, Optional) -> %% @doc Creates list of users with given input array %% -spec create_users_with_array_input(ctx:ctx(), list()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -create_users_with_array_input(Ctx, PetstoreUserArray) -> - create_users_with_array_input(Ctx, PetstoreUserArray, #{}). +create_users_with_array_input(Ctx, Body) -> + create_users_with_array_input(Ctx, Body, #{}). -spec create_users_with_array_input(ctx:ctx(), list(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -create_users_with_array_input(Ctx, PetstoreUserArray, Optional) -> +create_users_with_array_input(Ctx, Body, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -47,7 +47,7 @@ create_users_with_array_input(Ctx, PetstoreUserArray, Optional) -> Path = ["/user/createWithArray"], QS = [], Headers = [], - Body1 = PetstoreUserArray, + Body1 = Body, ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), @@ -56,11 +56,11 @@ create_users_with_array_input(Ctx, PetstoreUserArray, Optional) -> %% @doc Creates list of users with given input array %% -spec create_users_with_list_input(ctx:ctx(), list()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -create_users_with_list_input(Ctx, PetstoreUserArray) -> - create_users_with_list_input(Ctx, PetstoreUserArray, #{}). +create_users_with_list_input(Ctx, Body) -> + create_users_with_list_input(Ctx, Body, #{}). -spec create_users_with_list_input(ctx:ctx(), list(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -create_users_with_list_input(Ctx, PetstoreUserArray, Optional) -> +create_users_with_list_input(Ctx, Body, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -68,7 +68,7 @@ create_users_with_list_input(Ctx, PetstoreUserArray, Optional) -> Path = ["/user/createWithList"], QS = [], Headers = [], - Body1 = PetstoreUserArray, + Body1 = Body, ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), @@ -161,11 +161,11 @@ logout_user(Ctx, Optional) -> %% @doc Updated user %% This can only be done by the logged in user. -spec update_user(ctx:ctx(), binary(), petstore_user:petstore_user()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -update_user(Ctx, Username, PetstoreUser) -> - update_user(Ctx, Username, PetstoreUser, #{}). +update_user(Ctx, Username, Body) -> + update_user(Ctx, Username, Body, #{}). -spec update_user(ctx:ctx(), binary(), petstore_user:petstore_user(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -update_user(Ctx, Username, PetstoreUser, Optional) -> +update_user(Ctx, Username, Body, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -173,7 +173,7 @@ update_user(Ctx, Username, PetstoreUser, Optional) -> Path = ["/user/", Username, ""], QS = [], Headers = [], - Body1 = PetstoreUser, + Body1 = Body, ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), diff --git a/samples/client/petstore/erlang-proper/.openapi-generator/VERSION b/samples/client/petstore/erlang-proper/.openapi-generator/VERSION index a65271290834..bfbf77eb7fad 100644 --- a/samples/client/petstore/erlang-proper/.openapi-generator/VERSION +++ b/samples/client/petstore/erlang-proper/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.2-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-proper/src/petstore_api.erl b/samples/client/petstore/erlang-proper/src/petstore_api.erl index 2f852cfd4073..faf58355ab07 100644 --- a/samples/client/petstore/erlang-proper/src/petstore_api.erl +++ b/samples/client/petstore/erlang-proper/src/petstore_api.erl @@ -16,11 +16,11 @@ %% This can only be done by the logged in user. -spec create_user(petstore_user:petstore_user()) -> petstore_utils:response(). -create_user(PetstoreUser) -> +create_user(Body) -> Method = post, Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user"], - Body = PetstoreUser, + Body = Body, ContentType = "text/plain", petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). @@ -29,11 +29,11 @@ create_user(PetstoreUser) -> %% -spec create_users_with_array_input(list(petstore_user:petstore_user())) -> petstore_utils:response(). -create_users_with_array_input(PetstoreUserArray) -> +create_users_with_array_input(Body) -> Method = post, Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user/createWithArray"], - Body = PetstoreUserArray, + Body = Body, ContentType = "text/plain", petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). @@ -42,11 +42,11 @@ create_users_with_array_input(PetstoreUserArray) -> %% -spec create_users_with_list_input(list(petstore_user:petstore_user())) -> petstore_utils:response(). -create_users_with_list_input(PetstoreUserArray) -> +create_users_with_list_input(Body) -> Method = post, Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user/createWithList"], - Body = PetstoreUserArray, + Body = Body, ContentType = "text/plain", petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). @@ -100,11 +100,11 @@ logout_user() -> %% This can only be done by the logged in user. -spec update_user(binary(), petstore_user:petstore_user()) -> petstore_utils:response(). -update_user(Username, PetstoreUser) -> +update_user(Username, Body) -> Method = put, Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user/", Username, ""], - Body = PetstoreUser, + Body = Body, ContentType = "text/plain", petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). diff --git a/samples/client/petstore/erlang-proper/src/petstore_statem.erl b/samples/client/petstore/erlang-proper/src/petstore_statem.erl index 9244c6fbf0c0..cb6f3031e878 100644 --- a/samples/client/petstore/erlang-proper/src/petstore_statem.erl +++ b/samples/client/petstore/erlang-proper/src/petstore_statem.erl @@ -61,8 +61,8 @@ initial_state() -> #{}. %% create_user %%============================================================================== -create_user(PetstoreUser) -> - petstore_api:create_user(PetstoreUser). +create_user(Body) -> + petstore_api:create_user(Body). create_user_args(_S) -> [petstore_user:petstore_user()]. @@ -71,8 +71,8 @@ create_user_args(_S) -> %% create_users_with_array_input %%============================================================================== -create_users_with_array_input(PetstoreUserArray) -> - petstore_api:create_users_with_array_input(PetstoreUserArray). +create_users_with_array_input(Body) -> + petstore_api:create_users_with_array_input(Body). create_users_with_array_input_args(_S) -> [list(petstore_user:petstore_user())]. @@ -81,8 +81,8 @@ create_users_with_array_input_args(_S) -> %% create_users_with_list_input %%============================================================================== -create_users_with_list_input(PetstoreUserArray) -> - petstore_api:create_users_with_list_input(PetstoreUserArray). +create_users_with_list_input(Body) -> + petstore_api:create_users_with_list_input(Body). create_users_with_list_input_args(_S) -> [list(petstore_user:petstore_user())]. @@ -131,8 +131,8 @@ logout_user_args(_S) -> %% update_user %%============================================================================== -update_user(Username, PetstoreUser) -> - petstore_api:update_user(Username, PetstoreUser). +update_user(Username, Body) -> + petstore_api:update_user(Username, Body). update_user_args(_S) -> [binary(), petstore_user:petstore_user()]. diff --git a/samples/client/petstore/flash/.openapi-generator/VERSION b/samples/client/petstore/flash/.openapi-generator/VERSION index 096bf47efe31..bfbf77eb7fad 100644 --- a/samples/client/petstore/flash/.openapi-generator/VERSION +++ b/samples/client/petstore/flash/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/flash/flash/build.xml b/samples/client/petstore/flash/flash/build.xml index da3c67f83443..dedf7e030081 100644 --- a/samples/client/petstore/flash/flash/build.xml +++ b/samples/client/petstore/flash/flash/build.xml @@ -15,7 +15,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -189,4 +189,4 @@ - \ No newline at end of file + diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as index 3ad9c7c96dc1..4f6f089ddacc 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as @@ -38,7 +38,7 @@ public class PetApi extends OpenApi { /* * Returns void */ - public function add_pet (pet: Pet): String { + public function add_pet (body: Pet): String { // create path and map variables var path: String = "/pet".replace(/{format}/g,"xml"); @@ -53,7 +53,7 @@ public class PetApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, pet, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); var requestId: String = getUniqueId(); @@ -197,7 +197,7 @@ public class PetApi extends OpenApi { /* * Returns void */ - public function update_pet (pet: Pet): String { + public function update_pet (body: Pet): String { // create path and map variables var path: String = "/pet".replace(/{format}/g,"xml"); @@ -212,7 +212,7 @@ public class PetApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, pet, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, body, headerParams); var requestId: String = getUniqueId(); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as index d013f1a82d19..1fd7d4ec419c 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as @@ -118,7 +118,7 @@ public class StoreApi extends OpenApi { /* * Returns Order */ - public function place_order (order: Order): String { + public function place_order (body: Order): String { // create path and map variables var path: String = "/store/order".replace(/{format}/g,"xml"); @@ -133,7 +133,7 @@ public class StoreApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, order, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); var requestId: String = getUniqueId(); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as index 3f11ff6e7bda..936598c929dc 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as @@ -36,7 +36,7 @@ public class UserApi extends OpenApi { /* * Returns void */ - public function create_user (user: User): String { + public function create_user (body: User): String { // create path and map variables var path: String = "/user".replace(/{format}/g,"xml"); @@ -51,7 +51,7 @@ public class UserApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, user, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); var requestId: String = getUniqueId(); @@ -66,7 +66,7 @@ public class UserApi extends OpenApi { /* * Returns void */ - public function create_users_with_array_input (user: Array): String { + public function create_users_with_array_input (body: Array): String { // create path and map variables var path: String = "/user/createWithArray".replace(/{format}/g,"xml"); @@ -81,7 +81,7 @@ public class UserApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, user, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); var requestId: String = getUniqueId(); @@ -96,7 +96,7 @@ public class UserApi extends OpenApi { /* * Returns void */ - public function create_users_with_list_input (user: Array): String { + public function create_users_with_list_input (body: Array): String { // create path and map variables var path: String = "/user/createWithList".replace(/{format}/g,"xml"); @@ -111,7 +111,7 @@ public class UserApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, user, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); var requestId: String = getUniqueId(); @@ -250,7 +250,7 @@ if("null" != String(password)) /* * Returns void */ - public function update_user (username: String, user: User): String { + public function update_user (username: String, body: User): String { // create path and map variables var path: String = "/user/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username)); @@ -269,7 +269,7 @@ if("null" != String(password)) - var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, user, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, body, headerParams); var requestId: String = getUniqueId(); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as b/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as index 964dbc26d692..abb0fe121fb2 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as @@ -11,7 +11,7 @@ import flash.events.Event; public class ApiClientEvent extends Event{ /** - * Event type to indicate a unsuccessful invocation + * Event type to indicate an unsuccessful invocation */ public static const FAILURE_EVENT:String = "unsuccesfulInvocation"; @@ -33,4 +33,4 @@ public class ApiClientEvent extends Event{ super(type, bubbles, cancelable); } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/flash/git_push.sh b/samples/client/petstore/flash/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/flash/git_push.sh +++ b/samples/client/petstore/flash/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -28,7 +34,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_fake.go index 6a39cfa04ce1..55c51d6c3311 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake.go @@ -1755,7 +1755,7 @@ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Respo localVarQueryParams.Add("pipe", parameterToString(*r.pipe, "csv")) localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(*r.http, "space")) + localVarQueryParams.Add("http", parameterToString(*r.http, "ssv")) localVarQueryParams.Add("url", parameterToString(*r.url, "csv")) { t := *r.context 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 bad36447bd8e..903c2cd278a9 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -1215,7 +1215,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("http", parameterToString(http, "ssv")) localVarQueryParams.Add("url", parameterToString(url, "csv")) { t:=context diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 61f9d2ed9ec5..95cbc096ab1e 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -1214,7 +1214,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("http", parameterToString(http, "ssv")) localVarQueryParams.Add("url", parameterToString(url, "csv")) { t:=context diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java index 71dfcd555569..ad88302f204b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java @@ -407,7 +407,7 @@ public TestQueryParameterCollectionFormatQueryParams ioutil(final List v return this; } public TestQueryParameterCollectionFormatQueryParams http(final List value) { - put("http", EncodingUtils.encodeCollection(value, "space")); + put("http", EncodingUtils.encodeCollection(value, "ssv")); return this; } public TestQueryParameterCollectionFormatQueryParams url(final List value) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java index 71dfcd555569..ad88302f204b 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java @@ -407,7 +407,7 @@ public TestQueryParameterCollectionFormatQueryParams ioutil(final List v return this; } public TestQueryParameterCollectionFormatQueryParams http(final List value) { - put("http", EncodingUtils.encodeCollection(value, "space")); + put("http", EncodingUtils.encodeCollection(value, "ssv")); return this; } public TestQueryParameterCollectionFormatQueryParams url(final List value) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java index ea1d42bae884..3c3ca7c4c9c9 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java @@ -760,7 +760,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java index 6410a95d1731..506535e1d33e 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1149,7 +1149,7 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List testQueryParameterCollectionFormatWithHttpInfo(List testQueryParameterCollectionFormatWithHttpInfo(List pipe, List i List localVarQueryParams = new ArrayList<>(); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(ApiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("ssv", "http", http)); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 121867dd07a9..657e2dfd968b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1791,7 +1791,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } if (http != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 121867dd07a9..657e2dfd968b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1791,7 +1791,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } if (http != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java index 34b1bf258781..bd2b2386f2bc 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java @@ -732,7 +732,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java index 16ef84563250..2c5be6cd0ecb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java @@ -852,7 +852,7 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java index 16ef84563250..2c5be6cd0ecb 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java @@ -852,7 +852,7 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java index 1ce6dc060c27..1bfe577e26ca 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java @@ -408,7 +408,7 @@ void testJsonFormData( @PUT("/fake/test-query-paramters") Void testQueryParameterCollectionFormat( - @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SSVParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context ); /** @@ -424,6 +424,6 @@ Void testQueryParameterCollectionFormat( @PUT("/fake/test-query-paramters") void testQueryParameterCollectionFormat( - @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context, Callback cb + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SSVParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java index 0c05259fb1e8..b1a773c63d71 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ F.Promise> testJsonFormData( */ @PUT("fake/test-query-paramters") F.Promise> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java index f8a5c1f9ec2f..a9c8e3f16da0 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ CompletionStage> testJsonFormData( */ @PUT("fake/test-query-paramters") CompletionStage> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java index f8a5c1f9ec2f..a9c8e3f16da0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ CompletionStage> testJsonFormData( */ @PUT("fake/test-query-paramters") CompletionStage> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java index d536945d5d43..dbaa2f6d1b76 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -225,7 +225,7 @@ Call testJsonFormData( */ @PUT("fake/test-query-paramters") Call testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java index b17c3d20f2b4..438c244adc70 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -225,7 +225,7 @@ Observable testJsonFormData( */ @PUT("fake/test-query-paramters") Observable testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java index 82a7657309f2..a2d7e57449e9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -226,7 +226,7 @@ Completable testJsonFormData( */ @PUT("fake/test-query-paramters") Completable testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java index e32629442fd5..70b3577d960b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -650,7 +650,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i List localVarQueryParams = new ArrayList<>(); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index 186f35269cd7..46aded06d3f6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -626,7 +626,7 @@ public Mono testQueryParameterCollectionFormat(List pipe, List} tags Tags to filter by - * @param {!number=} opt_maxCount Maximum number of items to return * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise>} */ -API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_maxCount, opt_extraHttpRequestParams) { +API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/pet/findByTags'; @@ -186,10 +185,6 @@ API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_maxCount, opt_ex queryParameters['tags'] = tags; } - if (opt_maxCount !== undefined) { - queryParameters['maxCount'] = opt_maxCount; - } - /** @type {!Object} */ var httpRequestParams = { method: 'GET', @@ -246,11 +241,11 @@ API.Client.PetApi.prototype.getPetById = function(petId, opt_extraHttpRequestPar /** * Update an existing pet * - * @param {!Pet} pet Pet object that needs to be added to the store + * @param {!Pet} body Pet object that needs to be added to the store * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.PetApi.prototype.updatePet = function(pet, opt_extraHttpRequestParams) { +API.Client.PetApi.prototype.updatePet = function(body, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/pet'; @@ -259,16 +254,16 @@ API.Client.PetApi.prototype.updatePet = function(pet, opt_extraHttpRequestParams /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'pet' is set - if (!pet) { - throw new Error('Missing required parameter pet when calling updatePet'); + // verify required parameter 'body' is set + if (!body) { + throw new Error('Missing required parameter body when calling updatePet'); } /** @type {!Object} */ var httpRequestParams = { method: 'PUT', url: path, json: true, - data: pet, + data: body, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js b/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js index 6df64168d26f..f26328cb7c31 100644 --- a/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js +++ b/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js @@ -151,11 +151,11 @@ API.Client.StoreApi.prototype.getOrderById = function(orderId, opt_extraHttpRequ /** * Place an order for a pet * - * @param {!Order} order order placed for purchasing the pet + * @param {!Order} body order placed for purchasing the pet * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.StoreApi.prototype.placeOrder = function(order, opt_extraHttpRequestParams) { +API.Client.StoreApi.prototype.placeOrder = function(body, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/store/order'; @@ -164,16 +164,16 @@ API.Client.StoreApi.prototype.placeOrder = function(order, opt_extraHttpRequestP /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'order' is set - if (!order) { - throw new Error('Missing required parameter order when calling placeOrder'); + // verify required parameter 'body' is set + if (!body) { + throw new Error('Missing required parameter body when calling placeOrder'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: order, + data: body, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js b/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js index 1b8b3fc744b7..a5e5610f9a94 100644 --- a/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js +++ b/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js @@ -46,11 +46,11 @@ API.Client.UserApi.$inject = ['$http', '$httpParamSerializer', '$injector']; /** * Create user * This can only be done by the logged in user. - * @param {!User} user Created user object + * @param {!User} body Created user object * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.UserApi.prototype.createUser = function(user, opt_extraHttpRequestParams) { +API.Client.UserApi.prototype.createUser = function(body, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/user'; @@ -59,16 +59,16 @@ API.Client.UserApi.prototype.createUser = function(user, opt_extraHttpRequestPar /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'user' is set - if (!user) { - throw new Error('Missing required parameter user when calling createUser'); + // verify required parameter 'body' is set + if (!body) { + throw new Error('Missing required parameter body when calling createUser'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: user, + data: body, params: queryParameters, headers: headerParams }; @@ -83,11 +83,11 @@ API.Client.UserApi.prototype.createUser = function(user, opt_extraHttpRequestPar /** * Creates list of users with given input array * - * @param {!Array} user List of user object + * @param {!Array} body List of user object * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.UserApi.prototype.createUsersWithArrayInput = function(user, opt_extraHttpRequestParams) { +API.Client.UserApi.prototype.createUsersWithArrayInput = function(body, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/user/createWithArray'; @@ -96,16 +96,16 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(user, opt_extr /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'user' is set - if (!user) { - throw new Error('Missing required parameter user when calling createUsersWithArrayInput'); + // verify required parameter 'body' is set + if (!body) { + throw new Error('Missing required parameter body when calling createUsersWithArrayInput'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: user, + data: body, params: queryParameters, headers: headerParams }; @@ -120,11 +120,11 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(user, opt_extr /** * Creates list of users with given input array * - * @param {!Array} user List of user object + * @param {!Array} body List of user object * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.UserApi.prototype.createUsersWithListInput = function(user, opt_extraHttpRequestParams) { +API.Client.UserApi.prototype.createUsersWithListInput = function(body, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/user/createWithList'; @@ -133,16 +133,16 @@ API.Client.UserApi.prototype.createUsersWithListInput = function(user, opt_extra /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'user' is set - if (!user) { - throw new Error('Missing required parameter user when calling createUsersWithListInput'); + // verify required parameter 'body' is set + if (!body) { + throw new Error('Missing required parameter body when calling createUsersWithListInput'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: user, + data: body, params: queryParameters, headers: headerParams }; @@ -312,11 +312,11 @@ API.Client.UserApi.prototype.logoutUser = function(opt_extraHttpRequestParams) { * Updated user * This can only be done by the logged in user. * @param {!string} username name that need to be deleted - * @param {!User} user Updated user object + * @param {!User} body Updated user object * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.UserApi.prototype.updateUser = function(username, user, opt_extraHttpRequestParams) { +API.Client.UserApi.prototype.updateUser = function(username, body, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/user/{username}' .replace('{' + 'username' + '}', String(username)); @@ -330,16 +330,16 @@ API.Client.UserApi.prototype.updateUser = function(username, user, opt_extraHttp if (!username) { throw new Error('Missing required parameter username when calling updateUser'); } - // verify required parameter 'user' is set - if (!user) { - throw new Error('Missing required parameter user when calling updateUser'); + // verify required parameter 'body' is set + if (!body) { + throw new Error('Missing required parameter body when calling updateUser'); } /** @type {!Object} */ var httpRequestParams = { method: 'PUT', url: path, json: true, - data: user, + data: body, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index 8c3bffd8c857..316e9bd88182 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -692,7 +692,7 @@ export default class FakeApi { let queryParams = { 'pipe': this.apiClient.buildCollectionParam(pipe, 'csv'), 'ioutil': this.apiClient.buildCollectionParam(ioutil, 'csv'), - 'http': this.apiClient.buildCollectionParam(http, 'space'), + 'http': this.apiClient.buildCollectionParam(http, 'ssv'), 'url': this.apiClient.buildCollectionParam(url, 'csv'), 'context': this.apiClient.buildCollectionParam(context, 'multi') }; diff --git a/samples/client/petstore/javascript-flowtyped/.babelrc b/samples/client/petstore/javascript-flowtyped/.babelrc index 4bf17b5e66ec..49f99e74b524 100644 --- a/samples/client/petstore/javascript-flowtyped/.babelrc +++ b/samples/client/petstore/javascript-flowtyped/.babelrc @@ -1,6 +1,6 @@ { "presets": [ - "react-app", + ["react-app", { "absoluteRuntime": false }], "@babel/preset-flow" ], "plugins": [ diff --git a/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION b/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION index 83a328a9227e..bfbf77eb7fad 100644 --- a/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index 8c041077a12e..106c7ec20783 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -783,7 +783,7 @@ export default class FakeApi { let queryParams = { 'pipe': this.apiClient.buildCollectionParam(pipe, 'csv'), 'ioutil': this.apiClient.buildCollectionParam(ioutil, 'csv'), - 'http': this.apiClient.buildCollectionParam(http, 'space'), + 'http': this.apiClient.buildCollectionParam(http, 'ssv'), 'url': this.apiClient.buildCollectionParam(url, 'csv'), 'context': this.apiClient.buildCollectionParam(context, 'multi') }; diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index ed05ed8ee50c..65a657500484 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -831,7 +831,7 @@ }, 'http': { value: http, - collectionFormat: 'space' + collectionFormat: 'ssv' }, 'url': { value: url, diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index 7537c4189a20..3e132ea7d7bd 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -740,7 +740,7 @@ }, 'http': { value: http, - collectionFormat: 'space' + collectionFormat: 'ssv' }, 'url': { value: url, diff --git a/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION b/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION index afa636560641..bfbf77eb7fad 100644 --- a/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION +++ b/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java index 660962be0e43..85036661f993 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java @@ -53,13 +53,13 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String v) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java index 0ba245486396..ee8a2e071630 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java @@ -26,7 +26,7 @@ public class Pet { private Long id; @ApiModelProperty(value = "") - private Category category = null; + private Category category; @ApiModelProperty(example = "doggie", required = true, value = "") private String name; @@ -59,13 +59,13 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String v) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/client/petstore/jmeter/.openapi-generator/VERSION b/samples/client/petstore/jmeter/.openapi-generator/VERSION index 82602aa4190d..bfbf77eb7fad 100644 --- a/samples/client/petstore/jmeter/.openapi-generator/VERSION +++ b/samples/client/petstore/jmeter/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.3-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jmeter/PetApi.csv b/samples/client/petstore/jmeter/PetApi.csv index 2ab795b50f75..29b09a1715de 100644 --- a/samples/client/petstore/jmeter/PetApi.csv +++ b/samples/client/petstore/jmeter/PetApi.csv @@ -1,2 +1,2 @@ -testCase,httpStatusCode,pet,petId,apiKey,status,tags,petId,pet,petId,name,status,petId,additionalMetadata,file +testCase,httpStatusCode,body,petId,apiKey,status,tags,petId,body,petId,name,status,petId,additionalMetadata,file Success,200,0,0,0,0,0,0,0,0,0,0,0,0,0 \ No newline at end of file diff --git a/samples/client/petstore/jmeter/StoreApi.csv b/samples/client/petstore/jmeter/StoreApi.csv index 2ccf8884aff0..70fd54e2b204 100644 --- a/samples/client/petstore/jmeter/StoreApi.csv +++ b/samples/client/petstore/jmeter/StoreApi.csv @@ -1,2 +1,2 @@ -testCase,httpStatusCode,orderId,orderId,order +testCase,httpStatusCode,orderId,orderId,body Success,200,0,0,0 \ No newline at end of file diff --git a/samples/client/petstore/jmeter/UserApi.csv b/samples/client/petstore/jmeter/UserApi.csv index 66fcc84a5901..92242d4077c7 100644 --- a/samples/client/petstore/jmeter/UserApi.csv +++ b/samples/client/petstore/jmeter/UserApi.csv @@ -1,2 +1,2 @@ -testCase,httpStatusCode,user,user,user,username,username,username,password,username,user +testCase,httpStatusCode,body,body,body,username,username,username,password,username,body Success,200,0,0,0,0,0,0,0,0,0 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-uppercase-enum/.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/client/petstore/kotlin-uppercase-enum/build.gradle b/samples/client/petstore/kotlin-uppercase-enum/build.gradle index ed72aa19d9ef..56be0bd0dd87 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/build.gradle +++ b/samples/client/petstore/kotlin-uppercase-enum/build.gradle @@ -10,7 +10,7 @@ buildscript { ext.kotlin_version = '1.3.61' repositories { - mavenCentral() + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -20,7 +20,7 @@ buildscript { apply plugin: 'kotlin' repositories { - mavenCentral() + maven { url "https://repo1.maven.org/maven2" } } test { diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt index 8ed4de2768fe..ef1dc34d0386 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt @@ -58,11 +58,11 @@ class EnumApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { val localVarError = localVarResponse as ClientError<*> - throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode) + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) } ResponseType.ServerError -> { val localVarError = localVarResponse as ServerError<*> - throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode) + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) } } } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index d1d58ffd0e96..76490dd26cea 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -10,7 +10,16 @@ import okhttp3.HttpUrl.Companion.toHttpUrlOrNull import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request +import okhttp3.Headers +import okhttp3.MultipartBody import java.io.File +import java.net.URLConnection +import java.util.Date +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.LocalTime +import java.time.OffsetDateTime +import java.time.OffsetTime open class ApiClient(val baseUrl: String) { companion object { @@ -37,17 +46,55 @@ open class ApiClient(val baseUrl: String) { val builder: OkHttpClient.Builder = OkHttpClient.Builder() } + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + protected fun guessContentTypeFromFile(file: File): String { + val contentType = URLConnection.guessContentTypeFromName(file.name) + return contentType ?: "application/octet-stream" + } + protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = when { content is File -> content.asRequestBody( mediaType.toMediaTypeOrNull() ) - mediaType == FormDataMediaType || mediaType == FormUrlEncMediaType -> { + mediaType == FormDataMediaType -> { + MultipartBody.Builder() + .setType(MultipartBody.FORM) + .apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + if (value is File) { + val partHeaders = Headers.headersOf( + "Content-Disposition", + "form-data; name=\"$key\"; filename=\"${value.name}\"" + ) + val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() + addPart(partHeaders, value.asRequestBody(fileMediaType)) + } else { + val partHeaders = Headers.headersOf( + "Content-Disposition", + "form-data; name=\"$key\"" + ) + addPart( + partHeaders, + parameterToString(value).toRequestBody(null) + ) + } + } + }.build() + } + mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, value) + (content as Map).forEach { (key, value) -> + add(key, parameterToString(value)) } }.build() } @@ -139,12 +186,13 @@ open class ApiClient(val baseUrl: String) { response.headers.toMultimap() ) response.isClientError -> return ClientError( + response.message, response.body?.string(), response.code, response.headers.toMultimap() ) else -> return ServerError( - null, + response.message, response.body?.string(), response.code, response.headers.toMultimap() @@ -152,7 +200,33 @@ open class ApiClient(val baseUrl: String) { } } + protected fun parameterToString(value: Any?): String { + when (value) { + null -> { + return "" + } + is Array<*> -> { + return toMultiValue(value, "csv").toString() + } + is Iterable<*> -> { + return toMultiValue(value, "csv").toString() + } + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { + return parseDateToQueryString(value) + } + else -> { + return value.toString() + } + } + } + protected inline fun parseDateToQueryString(value : T): String { - return value.toString() + /* + .replace("\"", "") converts the json object string to an actual string for the query parameter. + The moshi or gson adapter allows a more generic solution instead of trying to use a native + formatter. It also easily allows to provide a simple way to define a custom date format pattern + inside a gson/moshi adapter. + */ + return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") } } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt index f1a8aecc914b..9dc8d8dbbfaa 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt @@ -4,7 +4,9 @@ enum class ResponseType { Success, Informational, Redirection, ClientError, ServerError } -abstract class ApiInfrastructureResponse(val responseType: ResponseType) { +interface Response + +abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -27,6 +29,7 @@ class Redirection( ) : ApiInfrastructureResponse(ResponseType.Redirection) class ClientError( + val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt index 41f529a5f36b..b5310e71f13c 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -3,14 +3,14 @@ package org.openapitools.client.infrastructure import java.lang.RuntimeException -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) { +open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { companion object { private const val serialVersionUID: Long = 123L } } -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) { +open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { companion object { private const val serialVersionUID: Long = 456L diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/models/PetEnum.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/models/PetEnum.kt index 14d9c16c408b..1d31ee94c35c 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/models/PetEnum.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/models/PetEnum.kt @@ -19,6 +19,7 @@ import com.squareup.moshi.Json * Values: MY_FIRST_VALUE,MY_SECOND_VALUE */ + enum class PetEnum(val value: kotlin.String){ @@ -31,5 +32,13 @@ enum class PetEnum(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + } diff --git a/samples/client/petstore/lua/.openapi-generator/VERSION b/samples/client/petstore/lua/.openapi-generator/VERSION index 2c6109e5bb82..bfbf77eb7fad 100644 --- a/samples/client/petstore/lua/.openapi-generator/VERSION +++ b/samples/client/petstore/lua/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.4 \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/lua/git_push.sh b/samples/client/petstore/lua/git_push.sh index 20057f67ade4..ced3be2b0c7b 100644 --- a/samples/client/petstore/lua/git_push.sh +++ b/samples/client/petstore/lua/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/lua/petstore/api/pet_api.lua b/samples/client/petstore/lua/petstore/api/pet_api.lua index d9ce3e8df7fd..b480504a9282 100644 --- a/samples/client/petstore/lua/petstore/api/pet_api.lua +++ b/samples/client/petstore/lua/petstore/api/pet_api.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] @@ -45,7 +45,7 @@ local function new_pet_api(authority, basePath, schemes) }, pet_api_mt) end -function pet_api:add_pet(pet) +function pet_api:add_pet(body) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -60,7 +60,7 @@ function pet_api:add_pet(pet) --local var_content_type = { "application/json", "application/xml" } req.headers:upsert("accept", "application/json") - req:set_body(dkjson.encode(pet)) + req:set_body(dkjson.encode(body)) -- oAuth if self.access_token then @@ -280,7 +280,7 @@ function pet_api:get_pet_by_id(pet_id) end end -function pet_api:update_pet(pet) +function pet_api:update_pet(body) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -295,7 +295,7 @@ function pet_api:update_pet(pet) --local var_content_type = { "application/json", "application/xml" } req.headers:upsert("accept", "application/json") - req:set_body(dkjson.encode(pet)) + req:set_body(dkjson.encode(body)) -- oAuth if self.access_token then diff --git a/samples/client/petstore/lua/petstore/api/store_api.lua b/samples/client/petstore/lua/petstore/api/store_api.lua index 456a1bb6018b..7ca504f484a1 100644 --- a/samples/client/petstore/lua/petstore/api/store_api.lua +++ b/samples/client/petstore/lua/petstore/api/store_api.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] @@ -171,7 +171,7 @@ function store_api:get_order_by_id(order_id) end end -function store_api:place_order(order) +function store_api:place_order(body) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -186,7 +186,7 @@ function store_api:place_order(order) --local var_accept = { "application/xml", "application/json" } req.headers:upsert("content-type", "application/xml") - req:set_body(dkjson.encode(order)) + req:set_body(dkjson.encode(body)) -- make the HTTP call diff --git a/samples/client/petstore/lua/petstore/api/user_api.lua b/samples/client/petstore/lua/petstore/api/user_api.lua index 6cc3f251976c..91e7778c8978 100644 --- a/samples/client/petstore/lua/petstore/api/user_api.lua +++ b/samples/client/petstore/lua/petstore/api/user_api.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] @@ -44,7 +44,7 @@ local function new_user_api(authority, basePath, schemes) }, user_api_mt) end -function user_api:create_user(user) +function user_api:create_user(body) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -55,7 +55,7 @@ function user_api:create_user(user) -- set HTTP verb req.headers:upsert(":method", "POST") - req:set_body(dkjson.encode(user)) + req:set_body(dkjson.encode(body)) -- make the HTTP call @@ -77,7 +77,7 @@ function user_api:create_user(user) end end -function user_api:create_users_with_array_input(user) +function user_api:create_users_with_array_input(body) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -88,7 +88,7 @@ function user_api:create_users_with_array_input(user) -- set HTTP verb req.headers:upsert(":method", "POST") - req:set_body(dkjson.encode(user)) + req:set_body(dkjson.encode(body)) -- make the HTTP call @@ -110,7 +110,7 @@ function user_api:create_users_with_array_input(user) end end -function user_api:create_users_with_list_input(user) +function user_api:create_users_with_list_input(body) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -121,7 +121,7 @@ function user_api:create_users_with_list_input(user) -- set HTTP verb req.headers:upsert(":method", "POST") - req:set_body(dkjson.encode(user)) + req:set_body(dkjson.encode(body)) -- make the HTTP call @@ -297,7 +297,7 @@ function user_api:logout_user() end end -function user_api:update_user(username, user) +function user_api:update_user(username, body) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -308,7 +308,7 @@ function user_api:update_user(username, user) -- set HTTP verb req.headers:upsert(":method", "PUT") - req:set_body(dkjson.encode(user)) + req:set_body(dkjson.encode(body)) -- make the HTTP call diff --git a/samples/client/petstore/lua/petstore/model/api_response.lua b/samples/client/petstore/lua/petstore/model/api_response.lua index e96796dc5d06..9531219b71b0 100644 --- a/samples/client/petstore/lua/petstore/model/api_response.lua +++ b/samples/client/petstore/lua/petstore/model/api_response.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/category.lua b/samples/client/petstore/lua/petstore/model/category.lua index 711124a4fbee..fd15b89da0e6 100644 --- a/samples/client/petstore/lua/petstore/model/category.lua +++ b/samples/client/petstore/lua/petstore/model/category.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/order.lua b/samples/client/petstore/lua/petstore/model/order.lua index 3b67e997f9eb..48a691b72d70 100644 --- a/samples/client/petstore/lua/petstore/model/order.lua +++ b/samples/client/petstore/lua/petstore/model/order.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/pet.lua b/samples/client/petstore/lua/petstore/model/pet.lua index 3a750e3a1a34..5f887e32b552 100644 --- a/samples/client/petstore/lua/petstore/model/pet.lua +++ b/samples/client/petstore/lua/petstore/model/pet.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/tag.lua b/samples/client/petstore/lua/petstore/model/tag.lua index 7daf7fcc7220..872dfab64bc7 100644 --- a/samples/client/petstore/lua/petstore/model/tag.lua +++ b/samples/client/petstore/lua/petstore/model/tag.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/user.lua b/samples/client/petstore/lua/petstore/model/user.lua index c7cb44013b6a..82539d731da6 100644 --- a/samples/client/petstore/lua/petstore/model/user.lua +++ b/samples/client/petstore/lua/petstore/model/user.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION index 096bf47efe31..bfbf77eb7fad 100644 --- a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/README.md b/samples/client/petstore/objc/core-data/README.md index 10694bd5135b..a596656fa57a 100644 --- a/samples/client/petstore/objc/core-data/README.md +++ b/samples/client/petstore/objc/core-data/README.md @@ -69,12 +69,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWithPet:pet +[apiInstance addPetWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h index 3783ee23362b..2753fa80578b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,12 +26,12 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Add a new pet to the store /// /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// code:405 message:"Invalid input" /// /// @return void --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; @@ -92,14 +92,14 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Update an existing pet /// /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// code:400 message:"Invalid ID supplied", /// code:404 message:"Pet not found", /// code:405 message:"Validation exception" /// /// @return void --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m index e57006827b99..49f8d5bc3078 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m @@ -52,11 +52,11 @@ -(NSDictionary *)defaultHeaders { /// /// Add a new pet to the store /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// @returns void /// --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -83,7 +83,7 @@ -(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = pet; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -193,7 +193,7 @@ -(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (status != nil) { - queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"csv"]; + queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -250,7 +250,7 @@ -(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (tags != nil) { - queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"csv"]; + queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -363,11 +363,11 @@ -(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId /// /// Update an existing pet /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// @returns void /// --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -394,7 +394,7 @@ -(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = pet; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"PUT" diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h index d578190189c1..52bc78432754 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -64,13 +64,13 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// Place an order for a pet /// /// -/// @param order order placed for purchasing the pet (optional) +/// @param body order placed for purchasing the pet (optional) /// /// code:200 message:"successful operation", /// code:400 message:"Invalid Order" /// /// @return SWGOrder* --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m index 4231e138bdaf..7d102a5c0d56 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m @@ -240,11 +240,11 @@ -(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId /// /// Place an order for a pet /// -/// @param order order placed for purchasing the pet (optional) +/// @param body order placed for purchasing the pet (optional) /// /// @returns SWGOrder* /// --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; @@ -271,7 +271,7 @@ -(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = order; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h index 5e0b6bbc8d83..63d35eb8960b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,36 +26,36 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Create user /// This can only be done by the logged in user. /// -/// @param user Created user object (optional) +/// @param body Created user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; /// Creates list of users with given input array /// /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; /// Creates list of users with given input array /// /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; @@ -116,14 +116,14 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// This can only be done by the logged in user. /// /// @param username name that need to be deleted -/// @param user Updated user object (optional) +/// @param body Updated user object (optional) /// /// code:400 message:"Invalid user supplied", /// code:404 message:"User not found" /// /// @return void -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user + body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m index 6ba11b3a44a1..da0d9cb68314 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m @@ -52,11 +52,11 @@ -(NSDictionary *)defaultHeaders { /// /// Create user /// This can only be done by the logged in user. -/// @param user Created user object (optional) +/// @param body Created user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; @@ -83,7 +83,7 @@ -(NSURLSessionTask*) createUserWithUser: (SWGUser*) user id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -107,11 +107,11 @@ -(NSURLSessionTask*) createUserWithUser: (SWGUser*) user /// /// Creates list of users with given input array /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; @@ -138,7 +138,7 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -162,11 +162,11 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user /// /// Creates list of users with given input array /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; @@ -193,7 +193,7 @@ -(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -470,12 +470,12 @@ -(NSURLSessionTask*) logoutUserWithCompletionHandler: /// This can only be done by the logged in user. /// @param username name that need to be deleted /// -/// @param user Updated user object (optional) +/// @param body Updated user object (optional) /// /// @returns void /// -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user + body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'username' is set if (username == nil) { @@ -516,7 +516,7 @@ -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"PUT" diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index 3925ca3728f8..5179ca2e99b8 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h index 2ac4a2cdc785..6c0396f0cac5 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h index 844893553809..04558b3d0a05 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h @@ -7,7 +7,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h index 1c3c741442de..f6b12de5c5c3 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h index 24d89beeb61e..e141e0d092d5 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -93,7 +93,7 @@ /** * Sets API key * - * To remove a apiKey for an identifier, just set the apiKey to nil. + * To remove an apiKey for an identifier, just set the apiKey to nil. * * @param apiKey API key or token. * @param identifier API key identifier (authentication schema). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h index 500664a38c51..943ab1323133 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h index bb3cb672c3eb..23f57acd7b8a 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h index 047f52c2bb5f..7d7112c5976a 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h index 2fd7c6dbec8b..4bd35d86f352 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h index e51705deb256..68f83704f495 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ extern NSInteger const SWGUnknownResponseObjectErrorCode; @interface SWGResponseDeserializer : NSObject /** - * If an null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored + * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored * @default NO */ @property (nonatomic, assign) BOOL treatNullAsError; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h index 4a2bea99fd05..83853bec8cf0 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h index efe582a11a46..31eb9e6b31ca 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h index 087efd870ee2..8bcb655d0fbc 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h index a99ae9176ff8..18863d14baf7 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h @@ -9,7 +9,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h index 11f27bdba3f8..5ea7a94cfcbe 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h index 1b773bbdbeb3..05f83ca11fd6 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h index 300e63b3a852..f67159446bc9 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h @@ -9,7 +9,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h index b3586e9ea821..4b3729193265 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h index d4cd41870ebf..6ad378e95f76 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h index dff2ad8447ea..112ba8bbff4f 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h @@ -11,7 +11,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h index 991526f5d5aa..cdcedfd916bb 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h index a028b8ef62e7..a646e643d70c 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h index 6c9db4e9fdaa..fe1abf098e0c 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h @@ -9,7 +9,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h index de28b05c42e2..7786883ed29c 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h index ff3539edada6..89f0f4938d81 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h index b35db434e03c..de1c284cde24 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h @@ -9,7 +9,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/git_push.sh b/samples/client/petstore/objc/core-data/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/objc/core-data/git_push.sh +++ b/samples/client/petstore/objc/core-data/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -28,7 +34,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/objc/default/.openapi-generator/VERSION b/samples/client/petstore/objc/default/.openapi-generator/VERSION index 096bf47efe31..bfbf77eb7fad 100644 --- a/samples/client/petstore/objc/default/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/default/README.md b/samples/client/petstore/objc/default/README.md index 10694bd5135b..a596656fa57a 100644 --- a/samples/client/petstore/objc/default/README.md +++ b/samples/client/petstore/objc/default/README.md @@ -69,12 +69,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWithPet:pet +[apiInstance addPetWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h index 3783ee23362b..2753fa80578b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,12 +26,12 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Add a new pet to the store /// /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// code:405 message:"Invalid input" /// /// @return void --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; @@ -92,14 +92,14 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Update an existing pet /// /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// code:400 message:"Invalid ID supplied", /// code:404 message:"Pet not found", /// code:405 message:"Validation exception" /// /// @return void --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m index e57006827b99..49f8d5bc3078 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m @@ -52,11 +52,11 @@ -(NSDictionary *)defaultHeaders { /// /// Add a new pet to the store /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// @returns void /// --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -83,7 +83,7 @@ -(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = pet; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -193,7 +193,7 @@ -(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (status != nil) { - queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"csv"]; + queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -250,7 +250,7 @@ -(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (tags != nil) { - queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"csv"]; + queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -363,11 +363,11 @@ -(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId /// /// Update an existing pet /// -/// @param pet Pet object that needs to be added to the store (optional) +/// @param body Pet object that needs to be added to the store (optional) /// /// @returns void /// --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -394,7 +394,7 @@ -(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = pet; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"PUT" diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h index d578190189c1..52bc78432754 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -64,13 +64,13 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// Place an order for a pet /// /// -/// @param order order placed for purchasing the pet (optional) +/// @param body order placed for purchasing the pet (optional) /// /// code:200 message:"successful operation", /// code:400 message:"Invalid Order" /// /// @return SWGOrder* --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m index 4231e138bdaf..7d102a5c0d56 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m @@ -240,11 +240,11 @@ -(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId /// /// Place an order for a pet /// -/// @param order order placed for purchasing the pet (optional) +/// @param body order placed for purchasing the pet (optional) /// /// @returns SWGOrder* /// --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; @@ -271,7 +271,7 @@ -(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = order; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h index 5e0b6bbc8d83..63d35eb8960b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,36 +26,36 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Create user /// This can only be done by the logged in user. /// -/// @param user Created user object (optional) +/// @param body Created user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; /// Creates list of users with given input array /// /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; /// Creates list of users with given input array /// /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; @@ -116,14 +116,14 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// This can only be done by the logged in user. /// /// @param username name that need to be deleted -/// @param user Updated user object (optional) +/// @param body Updated user object (optional) /// /// code:400 message:"Invalid user supplied", /// code:404 message:"User not found" /// /// @return void -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user + body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m index 6ba11b3a44a1..da0d9cb68314 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m @@ -52,11 +52,11 @@ -(NSDictionary *)defaultHeaders { /// /// Create user /// This can only be done by the logged in user. -/// @param user Created user object (optional) +/// @param body Created user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; @@ -83,7 +83,7 @@ -(NSURLSessionTask*) createUserWithUser: (SWGUser*) user id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -107,11 +107,11 @@ -(NSURLSessionTask*) createUserWithUser: (SWGUser*) user /// /// Creates list of users with given input array /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; @@ -138,7 +138,7 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -162,11 +162,11 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user /// /// Creates list of users with given input array /// -/// @param user List of user object (optional) +/// @param body List of user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; @@ -193,7 +193,7 @@ -(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -470,12 +470,12 @@ -(NSURLSessionTask*) logoutUserWithCompletionHandler: /// This can only be done by the logged in user. /// @param username name that need to be deleted /// -/// @param user Updated user object (optional) +/// @param body Updated user object (optional) /// /// @returns void /// -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user + body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'username' is set if (username == nil) { @@ -516,7 +516,7 @@ -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; + bodyParam = body; return [self.apiClient requestWithPath: resourcePath method: @"PUT" diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index 3925ca3728f8..5179ca2e99b8 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h index 2ac4a2cdc785..6c0396f0cac5 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h index 844893553809..04558b3d0a05 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h @@ -7,7 +7,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h index 1c3c741442de..f6b12de5c5c3 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h index 24d89beeb61e..e141e0d092d5 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -93,7 +93,7 @@ /** * Sets API key * - * To remove a apiKey for an identifier, just set the apiKey to nil. + * To remove an apiKey for an identifier, just set the apiKey to nil. * * @param apiKey API key or token. * @param identifier API key identifier (authentication schema). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h index 500664a38c51..943ab1323133 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h index bb3cb672c3eb..23f57acd7b8a 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h index 047f52c2bb5f..7d7112c5976a 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h index 2fd7c6dbec8b..4bd35d86f352 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h index e51705deb256..68f83704f495 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ extern NSInteger const SWGUnknownResponseObjectErrorCode; @interface SWGResponseDeserializer : NSObject /** - * If an null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored + * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored * @default NO */ @property (nonatomic, assign) BOOL treatNullAsError; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h index 4a2bea99fd05..83853bec8cf0 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h index efe582a11a46..31eb9e6b31ca 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h index 11f27bdba3f8..5ea7a94cfcbe 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h index b3586e9ea821..4b3729193265 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h index 991526f5d5aa..cdcedfd916bb 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h index de28b05c42e2..7786883ed29c 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* OpenAPI spec version: 1.0.0 +* The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/docs/SWGPetApi.md b/samples/client/petstore/objc/default/docs/SWGPetApi.md index e2dde91d7987..9f426a7e5ac9 100644 --- a/samples/client/petstore/objc/default/docs/SWGPetApi.md +++ b/samples/client/petstore/objc/default/docs/SWGPetApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **addPet** ```objc --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) addPetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -30,12 +30,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWithPet:pet +[apiInstance addPetWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGPetApi->addPet: %@", error); @@ -47,7 +47,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] + **body** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] ### Return type @@ -290,7 +290,7 @@ Name | Type | Description | Notes # **updatePet** ```objc --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet +-(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -304,12 +304,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; // Update an existing pet -[apiInstance updatePetWithPet:pet +[apiInstance updatePetWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGPetApi->updatePet: %@", error); @@ -321,7 +321,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] + **body** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] ### Return type diff --git a/samples/client/petstore/objc/default/docs/SWGStoreApi.md b/samples/client/petstore/objc/default/docs/SWGStoreApi.md index 572b556ac041..cebab19d2bfa 100644 --- a/samples/client/petstore/objc/default/docs/SWGStoreApi.md +++ b/samples/client/petstore/objc/default/docs/SWGStoreApi.md @@ -162,7 +162,7 @@ No authorization required # **placeOrder** ```objc --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order +-(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; ``` @@ -171,12 +171,12 @@ Place an order for a pet ### Example ```objc -SWGOrder* order = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional) +SWGOrder* body = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional) SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; // Place an order for a pet -[apiInstance placeOrderWithOrder:order +[apiInstance placeOrderWithBody:body completionHandler: ^(SWGOrder* output, NSError* error) { if (output) { NSLog(@"%@", output); @@ -191,7 +191,7 @@ SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional] + **body** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional] ### Return type diff --git a/samples/client/petstore/objc/default/docs/SWGUserApi.md b/samples/client/petstore/objc/default/docs/SWGUserApi.md index 8d28e604d0b3..f512a4fdeb6f 100644 --- a/samples/client/petstore/objc/default/docs/SWGUserApi.md +++ b/samples/client/petstore/objc/default/docs/SWGUserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** ```objc --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user +-(NSURLSessionTask*) createUserWithBody: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -27,12 +27,12 @@ This can only be done by the logged in user. ### Example ```objc -SWGUser* user = [[SWGUser alloc] init]; // Created user object (optional) +SWGUser* body = [[SWGUser alloc] init]; // Created user object (optional) SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; // Create user -[apiInstance createUserWithUser:user +[apiInstance createUserWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGUserApi->createUser: %@", error); @@ -44,7 +44,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**SWGUser***](SWGUser.md)| Created user object | [optional] + **body** | [**SWGUser***](SWGUser.md)| Created user object | [optional] ### Return type @@ -63,7 +63,7 @@ No authorization required # **createUsersWithArrayInput** ```objc --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -72,12 +72,12 @@ Creates list of users with given input array ### Example ```objc -NSArray* user = @[[[NSArray alloc] init]]; // List of user object (optional) +NSArray* body = @[[[SWGUser alloc] init]]; // List of user object (optional) SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; // Creates list of users with given input array -[apiInstance createUsersWithArrayInputWithUser:user +[apiInstance createUsersWithArrayInputWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGUserApi->createUsersWithArrayInput: %@", error); @@ -89,7 +89,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**NSArray<SWGUser>***](NSArray.md)| List of user object | [optional] + **body** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] ### Return type @@ -108,7 +108,7 @@ No authorization required # **createUsersWithListInput** ```objc --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user +-(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -117,12 +117,12 @@ Creates list of users with given input array ### Example ```objc -NSArray* user = @[[[NSArray alloc] init]]; // List of user object (optional) +NSArray* body = @[[[SWGUser alloc] init]]; // List of user object (optional) SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; // Creates list of users with given input array -[apiInstance createUsersWithListInputWithUser:user +[apiInstance createUsersWithListInputWithBody:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGUserApi->createUsersWithListInput: %@", error); @@ -134,7 +134,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**NSArray<SWGUser>***](NSArray.md)| List of user object | [optional] + **body** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] ### Return type @@ -342,7 +342,7 @@ No authorization required # **updateUser** ```objc -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user + body: (SWGUser*) body completionHandler: (void (^)(NSError* error)) handler; ``` @@ -354,13 +354,13 @@ This can only be done by the logged in user. ```objc NSString* username = @"username_example"; // name that need to be deleted -SWGUser* user = [[SWGUser alloc] init]; // Updated user object (optional) +SWGUser* body = [[SWGUser alloc] init]; // Updated user object (optional) SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; // Updated user [apiInstance updateUserWithUsername:username - user:user + body:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGUserApi->updateUser: %@", error); @@ -373,7 +373,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **NSString***| name that need to be deleted | - **user** | [**SWGUser***](SWGUser.md)| Updated user object | [optional] + **body** | [**SWGUser***](SWGUser.md)| Updated user object | [optional] ### Return type diff --git a/samples/client/petstore/objc/default/git_push.sh b/samples/client/petstore/objc/default/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/objc/default/git_push.sh +++ b/samples/client/petstore/objc/default/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -28,7 +34,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/ocaml/.openapi-generator/VERSION b/samples/client/petstore/ocaml/.openapi-generator/VERSION index e4955748d3e7..bfbf77eb7fad 100644 --- a/samples/client/petstore/ocaml/.openapi-generator/VERSION +++ b/samples/client/petstore/ocaml/.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/client/petstore/powershell/.openapi-generator/VERSION b/samples/client/petstore/powershell/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/client/petstore/powershell/.openapi-generator/VERSION +++ b/samples/client/petstore/powershell/.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/client/petstore/python-asyncio/petstore_api/api/fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py index 667c50612ce6..666463c335a8 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py @@ -1804,7 +1804,7 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht collection_formats['ioutil'] = 'csv' # noqa: E501 if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501 query_params.append(('http', local_var_params['http'])) # noqa: E501 - collection_formats['http'] = 'space' # noqa: E501 + collection_formats['http'] = 'ssv' # noqa: E501 if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501 query_params.append(('url', local_var_params['url'])) # noqa: E501 collection_formats['url'] = 'csv' # noqa: E501 diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py index 667c50612ce6..666463c335a8 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py @@ -1804,7 +1804,7 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht collection_formats['ioutil'] = 'csv' # noqa: E501 if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501 query_params.append(('http', local_var_params['http'])) # noqa: E501 - collection_formats['http'] = 'space' # noqa: E501 + collection_formats['http'] = 'ssv' # noqa: E501 if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501 query_params.append(('url', local_var_params['url'])) # noqa: E501 collection_formats['url'] = 'csv' # noqa: E501 diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index 667c50612ce6..666463c335a8 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -1804,7 +1804,7 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht collection_formats['ioutil'] = 'csv' # noqa: E501 if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501 query_params.append(('http', local_var_params['http'])) # noqa: E501 - collection_formats['http'] = 'space' # noqa: E501 + collection_formats['http'] = 'ssv' # noqa: E501 if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501 query_params.append(('url', local_var_params['url'])) # noqa: E501 collection_formats['url'] = 'csv' # noqa: E501 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index 3d226aeda296..1a5c080563e8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -1038,7 +1038,7 @@ def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, ur query_params = opts[:query_params] || {} query_params[:'pipe'] = @api_client.build_collection_param(pipe, :csv) query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) - query_params[:'http'] = @api_client.build_collection_param(http, :space) + query_params[:'http'] = @api_client.build_collection_param(http, :ssv) query_params[:'url'] = @api_client.build_collection_param(url, :csv) query_params[:'context'] = @api_client.build_collection_param(context, :multi) diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 3d226aeda296..1a5c080563e8 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -1038,7 +1038,7 @@ def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, ur query_params = opts[:query_params] || {} query_params[:'pipe'] = @api_client.build_collection_param(pipe, :csv) query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) - query_params[:'http'] = @api_client.build_collection_param(http, :space) + query_params[:'http'] = @api_client.build_collection_param(http, :ssv) query_params[:'url'] = @api_client.build_collection_param(url, :csv) query_params[:'context'] = @api_client.build_collection_param(context, :multi) diff --git a/samples/client/petstore/rust/hyper/fileResponseTest/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/fileResponseTest/.openapi-generator/VERSION index c3a2c7076fa8..bfbf77eb7fad 100644 --- a/samples/client/petstore/rust/hyper/fileResponseTest/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/hyper/fileResponseTest/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION index c3a2c7076fa8..bfbf77eb7fad 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/hyper/rust-test/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/rust-test/.openapi-generator/VERSION index c3a2c7076fa8..bfbf77eb7fad 100644 --- a/samples/client/petstore/rust/hyper/rust-test/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/hyper/rust-test/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/fileResponseTest/.openapi-generator/VERSION index c3a2c7076fa8..bfbf77eb7fad 100644 --- a/samples/client/petstore/rust/reqwest/fileResponseTest/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/fileResponseTest/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION index c3a2c7076fa8..bfbf77eb7fad 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/rust-test/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/rust-test/.openapi-generator/VERSION index c3a2c7076fa8..bfbf77eb7fad 100644 --- a/samples/client/petstore/rust/reqwest/rust-test/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/rust-test/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/DateTimeCodecs.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/DateTimeCodecs.scala index 890338a8ffb6..b91da00368d2 100644 --- a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/DateTimeCodecs.scala +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/DateTimeCodecs.scala @@ -4,6 +4,9 @@ import argonaut._ import argonaut.EncodeJson._ import argonaut.DecodeJson._ +import org.http4s._ +import org.http4s.{EntityDecoder, EntityEncoder} +import org.http4s.argonaut._ import java.time.OffsetDateTime object DateTimeCodecs { diff --git a/samples/client/petstore/swift/default/.openapi-generator/VERSION b/samples/client/petstore/swift/default/.openapi-generator/VERSION index 6d94c9c2e12a..bfbf77eb7fad 100644 --- a/samples/client/petstore/swift/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index bff5744506d7..2e354e541811 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -5,8 +5,8 @@ // class APIHelper { - static func rejectNil(source: [String: AnyObject?]) -> [String: AnyObject]? { - var destination = [String: AnyObject]() + static func rejectNil(source: [String:AnyObject?]) -> [String:AnyObject]? { + var destination = [String:AnyObject]() for (key, nillableValue) in source { if let value: AnyObject = nillableValue { destination[key] = value @@ -19,8 +19,8 @@ class APIHelper { return destination } - static func rejectNilHeaders(source: [String: AnyObject?]) -> [String: String] { - var destination = [String: String]() + static func rejectNilHeaders(source: [String:AnyObject?]) -> [String:String] { + var destination = [String:String]() for (key, nillableValue) in source { if let value: AnyObject = nillableValue { destination[key] = "\(value)" @@ -29,11 +29,11 @@ class APIHelper { return destination } - static func convertBoolToString(source: [String: AnyObject]?) -> [String: AnyObject]? { + static func convertBoolToString(source: [String: AnyObject]?) -> [String:AnyObject]? { guard let source = source else { return nil } - var destination = [String: AnyObject]() + var destination = [String:AnyObject]() let theTrue = NSNumber(bool: true) let theFalse = NSNumber(bool: false) for (key, value) in source { diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index 676a325d49a0..1c2511ded518 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,7 +9,7 @@ import Foundation public class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io/v2" public static var credential: NSURLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } @@ -18,44 +18,44 @@ public class APIBase { let encoded: AnyObject? = encodable?.encodeToJSON() if encoded! is [AnyObject] { - var dictionary = [String: AnyObject]() + var dictionary = [String:AnyObject]() for (index, item) in (encoded as! [AnyObject]).enumerate() { dictionary["\(index)"] = item } return dictionary } else { - return encoded as? [String: AnyObject] + return encoded as? [String:AnyObject] } } } public class RequestBuilder { var credential: NSURLCredential? - var headers: [String: String] - let parameters: [String: AnyObject]? + var headers: [String:String] + let parameters: [String:AnyObject]? let isBody: Bool let method: String let URLString: String - + /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((NSProgress) -> Void)? + public var onProgressReady: ((NSProgress) -> ())? - required public init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:AnyObject]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters self.isBody = isBody self.headers = headers - + addHeaders(PetstoreClientAPI.customHeaders) } - - public func addHeaders(aHeaders: [String: String]) { + + public func addHeaders(aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } } - + public func execute(completion: (response: Response?, error: ErrorType?) -> Void) { } public func addHeader(name name: String, value: String) -> Self { @@ -64,7 +64,7 @@ public class RequestBuilder { } return self } - + public func addCredential() -> Self { self.credential = PetstoreClientAPI.credential return self @@ -74,3 +74,4 @@ public class RequestBuilder { protocol RequestBuilderFactory { func getBuilder() -> RequestBuilder.Type } + diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 9c663a5fabe7..81af6c0d6292 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,35 +7,38 @@ import Alamofire + + public class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in - completion(error: error) + public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } + /** Add a new pet to the store - POST /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { + public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -49,11 +52,12 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deletePet(petId petId: Int64, apiKey: String? = nil, completion: ((error: ErrorType?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - completion(error: error) + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + completion(error: error); } } + /** Deletes a pet - DELETE /pet/{petId} - OAuth: @@ -69,16 +73,16 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) let nillableHeaders: [String: AnyObject?] = [ "api_key": apiKey ] let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true, headers: headerParameters) @@ -92,10 +96,11 @@ public class PetAPI: APIBase { */ public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } + /** Finds Pets by status - GET /pet/findByStatus @@ -118,7 +123,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -127,7 +132,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -144,7 +149,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -153,7 +158,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter status: (query) Status values that need to be considered for filter (optional) - returns: RequestBuilder<[Pet]> @@ -162,14 +167,14 @@ public class PetAPI: APIBase { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "status": status ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -183,10 +188,11 @@ public class PetAPI: APIBase { */ public class func findPetsByTags(tags tags: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } + /** Finds Pets by tags - GET /pet/findByTags @@ -209,7 +215,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -218,7 +224,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -235,7 +241,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -244,7 +250,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter tags: (query) Tags to filter by (optional) - returns: RequestBuilder<[Pet]> @@ -253,14 +259,14 @@ public class PetAPI: APIBase { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "tags": tags ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -274,10 +280,11 @@ public class PetAPI: APIBase { */ public class func getPetById(petId petId: Int64, completion: ((data: Pet?, error: ErrorType?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } + /** Find pet by ID - GET /pet/{petId} @@ -303,7 +310,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -312,7 +319,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -329,7 +336,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -338,7 +345,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter petId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -348,12 +355,12 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -362,31 +369,32 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in - completion(error: error) + public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } + /** Update an existing pet - PUT /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { + public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -401,11 +409,12 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - completion(error: error) + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + completion(error: error); } } + /** Updates a pet in the store with form data - POST /pet/{petId} - OAuth: @@ -422,15 +431,15 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "name": name, "status": status ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -445,11 +454,12 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil, completion: ((error: ErrorType?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (_, error) -> Void in - completion(error: error) + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in + completion(error: error); } } + /** uploads an image - POST /pet/{petId}/uploadImage - OAuth: @@ -466,15 +476,15 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "additionalMetadata": additionalMetadata, "file": file ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index b745aad140b8..eef30d2814c7 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Alamofire + + public class StoreAPI: APIBase { /** Delete purchase order by ID @@ -15,11 +17,12 @@ public class StoreAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deleteOrder(orderId orderId: String, completion: ((error: ErrorType?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - completion(error: error) + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + completion(error: error); } } + /** Delete purchase order by ID - DELETE /store/order/{orderId} @@ -32,12 +35,12 @@ public class StoreAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -48,12 +51,13 @@ public class StoreAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ - public class func getInventory(completion: ((data: [String: Int32]?, error: ErrorType?) -> Void)) { + public class func getInventory(completion: ((data: [String:Int32]?, error: ErrorType?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } + /** Returns pet inventories by status - GET /store/inventory @@ -63,17 +67,17 @@ public class StoreAPI: APIBase { - returns: RequestBuilder<[String:Int32]> */ - public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int32]> { + public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[String: Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) } @@ -86,10 +90,11 @@ public class StoreAPI: APIBase { */ public class func getOrderById(orderId orderId: String, completion: ((data: Order?, error: ErrorType?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } + /** Find purchase order by ID - GET /store/order/{orderId} @@ -100,14 +105,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -115,14 +120,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -132,12 +137,12 @@ public class StoreAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -146,15 +151,16 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet (optional) + - parameter body: (body) order placed for purchasing the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(data: response?.body, error: error); } } + /** Place an order for a pet - POST /store/order - examples: [{contentType=application/json, example={ @@ -164,14 +170,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -179,25 +185,25 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] - - parameter order: (body) order placed for purchasing the pet (optional) +, statusCode=200}] + - parameter body: (body) order placed for purchasing the pet (optional) - returns: RequestBuilder */ - public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { + public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 0f5a31fee5ee..73760fe6268d 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,33 +7,36 @@ import Alamofire + + public class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object (optional) + - parameter body: (body) Created user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) + public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } + /** Create user - POST /user - - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) + - This can only be done by the logged in user. - parameter body: (body) Created user object (optional) - returns: RequestBuilder */ - public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { + public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -42,28 +45,29 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) + public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } + /** Creates list of users with given input array - - POST /user/createWithArray - parameter user: (body) List of user object (optional) + - POST /user/createWithArray - parameter body: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { + public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -72,28 +76,29 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) + public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } + /** Creates list of users with given input array - - POST /user/createWithList - parameter user: (body) List of user object (optional) + - POST /user/createWithList - parameter body: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { + public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -106,11 +111,12 @@ public class UserAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deleteUser(username username: String, completion: ((error: ErrorType?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - completion(error: error) + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + completion(error: error); } } + /** Delete user - DELETE /user/{username} @@ -123,12 +129,12 @@ public class UserAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -142,10 +148,11 @@ public class UserAPI: APIBase { */ public class func getUserByName(username username: String, completion: ((data: User?, error: ErrorType?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } + /** Get user by user name - GET /user/{username} - examples: [{contentType=application/json, example={ @@ -157,7 +164,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -166,7 +173,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", @@ -176,7 +183,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -185,7 +192,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -}] +, statusCode=200}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder @@ -195,12 +202,12 @@ public class UserAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -215,10 +222,11 @@ public class UserAPI: APIBase { */ public class func loginUser(username username: String? = nil, password: String? = nil, completion: ((data: String?, error: ErrorType?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } + /** Logs user into the system - GET /user/login - parameter username: (query) The user name for login (optional) @@ -230,15 +238,15 @@ public class UserAPI: APIBase { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "username": username, "password": password ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -250,11 +258,12 @@ public class UserAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func logoutUser(completion: ((error: ErrorType?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - completion(error: error) + logoutUserWithRequestBuilder().execute { (response, error) -> Void in + completion(error: error); } } + /** Logs out current logged in user session - GET /user/logout @@ -264,12 +273,12 @@ public class UserAPI: APIBase { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -279,31 +288,32 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (_, error) -> Void in - completion(error: error) + public class func updateUser(username username: String, body: User? = nil, completion: ((error: ErrorType?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + completion(error: error); } } + /** Updated user - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - returns: RequestBuilder */ - public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { + public class func updateUserWithRequestBuilder(username username: String, body: User? = nil) -> RequestBuilder { var path = "/user/{username}" path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 38e0a086d733..6752df2dfc01 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -41,7 +41,7 @@ public struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() class AlamofireRequestBuilder: RequestBuilder { - required init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { + required init(method: String, URLString: String, parameters: [String : AnyObject]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 603983e248ae..c04e734a7cb8 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -50,7 +50,7 @@ extension Array: JSONEncodable { extension Dictionary: JSONEncodable { func encodeToJSON() -> AnyObject { - var dictionary = [NSObject: AnyObject]() + var dictionary = [NSObject:AnyObject]() for (key, value) in self { dictionary[key as! NSObject] = encodeIfPossible(value) } @@ -114,7 +114,7 @@ public final class ISOFullDate: CustomStringConvertible { [ .Year, .Month, - .Day + .Day, ], fromDate: date ) @@ -175,3 +175,5 @@ extension ISOFullDate: JSONEncodable { return "\(year)-\(month)-\(day)" } } + + diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 774bb1737b7d..37d49d13e22e 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> AnyObject } -public enum ErrorResponse: ErrorType { +public enum ErrorResponse : ErrorType { case Error(Int, NSData?, ErrorType) } @@ -27,7 +27,7 @@ public class Response { public convenience init(response: NSHTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } @@ -37,7 +37,7 @@ public class Response { private var once = dispatch_once_t() class Decoders { - static private var decoders = [String: ((AnyObject) -] AnyObject)>() + static private var decoders = Dictionary AnyObject)>() static func addDecoder(clazz clazz: T.Type, decoder: ((AnyObject) -> T)) { let key = "\(T.self)" @@ -49,9 +49,9 @@ class Decoders { return array.map { Decoders.decode(clazz: T.self, source: $0) } } - static func decode(clazz clazz: [Key: T].Type, source: AnyObject) -> [Key: T] { + static func decode(clazz clazz: [Key:T].Type, source: AnyObject) -> [Key:T] { let sourceDictionary = source as! [Key: AnyObject] - var dictionary = [Key: T]() + var dictionary = [Key:T]() for (key, value) in sourceDictionary { dictionary[key] = Decoders.decode(clazz: T.self, source: value) } @@ -61,10 +61,10 @@ class Decoders { static func decode(clazz clazz: T.Type, source: AnyObject) -> T { initialize() if T.self is Int32.Type && source is NSNumber { - return source.intValue as! T + return source.intValue as! T; } if T.self is Int64.Type && source is NSNumber { - return source.longLongValue as! T + return source.longLongValue as! T; } if T.self is NSUUID.Type && source is String { return NSUUID(UUIDString: source as! String) as! T @@ -102,11 +102,11 @@ class Decoders { } } - static func decodeOptional(clazz clazz: [Key: T].Type, source: AnyObject?) -> [Key: T]? { + static func decodeOptional(clazz clazz: [Key:T].Type, source: AnyObject?) -> [Key:T]? { if source is NSNull { return nil } - return source.map { (someSource: AnyObject) -> [Key: T] in + return source.map { (someSource: AnyObject) -> [Key:T] in Decoders.decode(clazz: clazz, source: someSource) } } @@ -121,7 +121,7 @@ class Decoders { "yyyy-MM-dd'T'HH:mm:ss.SSS" ].map { (format: String) -> NSDateFormatter in let formatter = NSDateFormatter() - formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") + formatter.locale = NSLocale(localeIdentifier:"en_US_POSIX") formatter.dateFormat = format return formatter } @@ -149,7 +149,7 @@ class Decoders { return isoDate } fatalError("formatter failed to parse \(source)") - }) + }) // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject) -> [Category] in @@ -157,67 +157,71 @@ class Decoders { } // Decoder for Category Decoders.addDecoder(clazz: Category.self) { (source: AnyObject) -> Category in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = Category() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) return instance } + // Decoder for [Order] Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject) -> [Order] in return Decoders.decode(clazz: [Order].self, source: source) } // Decoder for Order Decoders.addDecoder(clazz: Order.self) { (source: AnyObject) -> Order in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = Order() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.petId = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"]) instance.quantity = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"]) instance.shipDate = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["shipDate"]) - instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") instance.complete = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"]) return instance } + // Decoder for [Pet] Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject) -> [Pet] in return Decoders.decode(clazz: [Pet].self, source: source) } // Decoder for Pet Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject) -> Pet in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = Pet() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.category = Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"]) instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"]) - instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") return instance } + // Decoder for [Tag] Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject) -> [Tag] in return Decoders.decode(clazz: [Tag].self, source: source) } // Decoder for Tag Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject) -> Tag in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = Tag() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) return instance } + // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject) -> [User] in return Decoders.decode(clazz: [User].self, source: source) } // Decoder for User Decoders.addDecoder(clazz: User.self) { (source: AnyObject) -> User in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = User() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.username = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"]) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index b3cbea28b69b..ea5e47f3cfd4 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,6 +7,7 @@ import Foundation + public class Category: JSONEncodable { public var id: Int64? public var name: String? @@ -15,10 +16,10 @@ public class Category: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index bb7860b9483f..90dfd9412255 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,8 +7,9 @@ import Foundation + public class Order: JSONEncodable { - public enum Status: String { + public enum Status: String { case Placed = "placed" case Approved = "approved" case Delivered = "delivered" @@ -25,14 +26,14 @@ public class Order: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["petId"] = self.petId?.encodeToJSON() nillableDictionary["quantity"] = self.quantity?.encodeToJSON() nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() nillableDictionary["status"] = self.status?.rawValue nillableDictionary["complete"] = self.complete - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 5fa39ec431a4..f24e12684e2b 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,8 +7,9 @@ import Foundation + public class Pet: JSONEncodable { - public enum Status: String { + public enum Status: String { case Available = "available" case Pending = "pending" case Sold = "sold" @@ -25,14 +26,14 @@ public class Pet: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["category"] = self.category?.encodeToJSON() nillableDictionary["name"] = self.name nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() nillableDictionary["tags"] = self.tags?.encodeToJSON() nillableDictionary["status"] = self.status?.rawValue - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index df2d12e84fc1..d79d8df25ec9 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,6 +7,7 @@ import Foundation + public class Tag: JSONEncodable { public var id: Int64? public var name: String? @@ -15,10 +16,10 @@ public class Tag: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index d24a21544177..c4032cd38698 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,6 +7,7 @@ import Foundation + public class User: JSONEncodable { public var id: Int64? public var username: String? @@ -22,7 +23,7 @@ public class User: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["username"] = self.username nillableDictionary["firstName"] = self.firstName @@ -31,7 +32,7 @@ public class User: JSONEncodable { nillableDictionary["password"] = self.password nillableDictionary["phone"] = self.phone nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/default/git_push.sh b/samples/client/petstore/swift/default/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/swift/default/git_push.sh +++ b/samples/client/petstore/swift/default/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -28,7 +34,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION index 6d94c9c2e12a..bfbf77eb7fad 100644 --- a/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION +++ b/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index bff5744506d7..2e354e541811 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -5,8 +5,8 @@ // class APIHelper { - static func rejectNil(source: [String: AnyObject?]) -> [String: AnyObject]? { - var destination = [String: AnyObject]() + static func rejectNil(source: [String:AnyObject?]) -> [String:AnyObject]? { + var destination = [String:AnyObject]() for (key, nillableValue) in source { if let value: AnyObject = nillableValue { destination[key] = value @@ -19,8 +19,8 @@ class APIHelper { return destination } - static func rejectNilHeaders(source: [String: AnyObject?]) -> [String: String] { - var destination = [String: String]() + static func rejectNilHeaders(source: [String:AnyObject?]) -> [String:String] { + var destination = [String:String]() for (key, nillableValue) in source { if let value: AnyObject = nillableValue { destination[key] = "\(value)" @@ -29,11 +29,11 @@ class APIHelper { return destination } - static func convertBoolToString(source: [String: AnyObject]?) -> [String: AnyObject]? { + static func convertBoolToString(source: [String: AnyObject]?) -> [String:AnyObject]? { guard let source = source else { return nil } - var destination = [String: AnyObject]() + var destination = [String:AnyObject]() let theTrue = NSNumber(bool: true) let theFalse = NSNumber(bool: false) for (key, value) in source { diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift index 676a325d49a0..1c2511ded518 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,7 +9,7 @@ import Foundation public class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io/v2" public static var credential: NSURLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } @@ -18,44 +18,44 @@ public class APIBase { let encoded: AnyObject? = encodable?.encodeToJSON() if encoded! is [AnyObject] { - var dictionary = [String: AnyObject]() + var dictionary = [String:AnyObject]() for (index, item) in (encoded as! [AnyObject]).enumerate() { dictionary["\(index)"] = item } return dictionary } else { - return encoded as? [String: AnyObject] + return encoded as? [String:AnyObject] } } } public class RequestBuilder { var credential: NSURLCredential? - var headers: [String: String] - let parameters: [String: AnyObject]? + var headers: [String:String] + let parameters: [String:AnyObject]? let isBody: Bool let method: String let URLString: String - + /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((NSProgress) -> Void)? + public var onProgressReady: ((NSProgress) -> ())? - required public init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:AnyObject]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters self.isBody = isBody self.headers = headers - + addHeaders(PetstoreClientAPI.customHeaders) } - - public func addHeaders(aHeaders: [String: String]) { + + public func addHeaders(aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } } - + public func execute(completion: (response: Response?, error: ErrorType?) -> Void) { } public func addHeader(name name: String, value: String) -> Self { @@ -64,7 +64,7 @@ public class RequestBuilder { } return self } - + public func addCredential() -> Self { self.credential = PetstoreClientAPI.credential return self @@ -74,3 +74,4 @@ public class RequestBuilder { protocol RequestBuilderFactory { func getBuilder() -> RequestBuilder.Type } + diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 82516e473233..ce762b3a138d 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,28 +8,30 @@ import Alamofire import PromiseKit + + public class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in - completion(error: error) + public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: Promise */ - public class func addPet(pet pet: Pet? = nil) -> Promise { + public class func addPet(body body: Pet? = nil) -> Promise { let deferred = Promise.pendingPromise() - addPet(pet: pet) { error in + addPet(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -44,17 +46,17 @@ public class PetAPI: APIBase { - POST /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { + public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -68,8 +70,8 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deletePet(petId petId: Int64, apiKey: String? = nil, completion: ((error: ErrorType?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - completion(error: error) + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + completion(error: error); } } @@ -107,16 +109,16 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) let nillableHeaders: [String: AnyObject?] = [ "api_key": apiKey ] let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true, headers: headerParameters) @@ -130,7 +132,7 @@ public class PetAPI: APIBase { */ public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -174,7 +176,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -183,7 +185,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -200,7 +202,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -209,7 +211,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter status: (query) Status values that need to be considered for filter (optional) - returns: RequestBuilder<[Pet]> @@ -218,14 +220,14 @@ public class PetAPI: APIBase { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "status": status ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -239,7 +241,7 @@ public class PetAPI: APIBase { */ public class func findPetsByTags(tags tags: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -283,7 +285,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -292,7 +294,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -309,7 +311,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -318,7 +320,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter tags: (query) Tags to filter by (optional) - returns: RequestBuilder<[Pet]> @@ -327,14 +329,14 @@ public class PetAPI: APIBase { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "tags": tags ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -348,7 +350,7 @@ public class PetAPI: APIBase { */ public class func getPetById(petId petId: Int64, completion: ((data: Pet?, error: ErrorType?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -395,7 +397,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -404,7 +406,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -421,7 +423,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -430,7 +432,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter petId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -440,12 +442,12 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -454,24 +456,24 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in - completion(error: error) + public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: Promise */ - public class func updatePet(pet pet: Pet? = nil) -> Promise { + public class func updatePet(body body: Pet? = nil) -> Promise { let deferred = Promise.pendingPromise() - updatePet(pet: pet) { error in + updatePet(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -486,17 +488,17 @@ public class PetAPI: APIBase { - PUT /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { + public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -511,8 +513,8 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - completion(error: error) + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + completion(error: error); } } @@ -552,15 +554,15 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "name": name, "status": status ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -575,8 +577,8 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil, completion: ((error: ErrorType?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (_, error) -> Void in - completion(error: error) + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in + completion(error: error); } } @@ -616,15 +618,15 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "additionalMetadata": additionalMetadata, "file": file ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 9f2fd4ee2693..b9ae6984e129 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Alamofire import PromiseKit + + public class StoreAPI: APIBase { /** Delete purchase order by ID @@ -16,8 +18,8 @@ public class StoreAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deleteOrder(orderId orderId: String, completion: ((error: ErrorType?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - completion(error: error) + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + completion(error: error); } } @@ -51,12 +53,12 @@ public class StoreAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -67,9 +69,9 @@ public class StoreAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ - public class func getInventory(completion: ((data: [String: Int32]?, error: ErrorType?) -> Void)) { + public class func getInventory(completion: ((data: [String:Int32]?, error: ErrorType?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -78,9 +80,9 @@ public class StoreAPI: APIBase { - returns: Promise<[String:Int32]> */ - public class func getInventory() -> Promise<[String: Int32]> { - let deferred = Promise<[String: Int32]>.pendingPromise() - getInventory { data, error in + public class func getInventory() -> Promise<[String:Int32]> { + let deferred = Promise<[String:Int32]>.pendingPromise() + getInventory() { data, error in if let error = error { deferred.reject(error) } else { @@ -99,17 +101,17 @@ public class StoreAPI: APIBase { - returns: RequestBuilder<[String:Int32]> */ - public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int32]> { + public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[String: Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) } @@ -122,7 +124,7 @@ public class StoreAPI: APIBase { */ public class func getOrderById(orderId orderId: String, completion: ((data: Order?, error: ErrorType?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -154,14 +156,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -169,14 +171,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -186,12 +188,12 @@ public class StoreAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -200,24 +202,24 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet (optional) + - parameter body: (body) order placed for purchasing the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(data: response?.body, error: error); } } /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet (optional) + - parameter body: (body) order placed for purchasing the pet (optional) - returns: Promise */ - public class func placeOrder(order order: Order? = nil) -> Promise { + public class func placeOrder(body body: Order? = nil) -> Promise { let deferred = Promise.pendingPromise() - placeOrder(order: order) { data, error in + placeOrder(body: body) { data, error in if let error = error { deferred.reject(error) } else { @@ -236,14 +238,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -251,25 +253,25 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] - - parameter order: (body) order placed for purchasing the pet (optional) +, statusCode=200}] + - parameter body: (body) order placed for purchasing the pet (optional) - returns: RequestBuilder */ - public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { + public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index f1030ea58794..573b8fe14bc7 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,28 +8,30 @@ import Alamofire import PromiseKit + + public class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object (optional) + - parameter body: (body) Created user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) + public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } /** Create user - - parameter user: (body) Created user object (optional) + - parameter body: (body) Created user object (optional) - returns: Promise */ - public class func createUser(user user: User? = nil) -> Promise { + public class func createUser(body body: User? = nil) -> Promise { let deferred = Promise.pendingPromise() - createUser(user: user) { error in + createUser(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -42,17 +44,17 @@ public class UserAPI: APIBase { /** Create user - POST /user - - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) + - This can only be done by the logged in user. - parameter body: (body) Created user object (optional) - returns: RequestBuilder */ - public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { + public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -61,24 +63,24 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) + public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - returns: Promise */ - public class func createUsersWithArrayInput(user user: [User]? = nil) -> Promise { + public class func createUsersWithArrayInput(body body: [User]? = nil) -> Promise { let deferred = Promise.pendingPromise() - createUsersWithArrayInput(user: user) { error in + createUsersWithArrayInput(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -90,17 +92,17 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithArray - parameter user: (body) List of user object (optional) + - POST /user/createWithArray - parameter body: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { + public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -109,24 +111,24 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) + public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - returns: Promise */ - public class func createUsersWithListInput(user user: [User]? = nil) -> Promise { + public class func createUsersWithListInput(body body: [User]? = nil) -> Promise { let deferred = Promise.pendingPromise() - createUsersWithListInput(user: user) { error in + createUsersWithListInput(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -138,17 +140,17 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithList - parameter user: (body) List of user object (optional) + - POST /user/createWithList - parameter body: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { + public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -161,8 +163,8 @@ public class UserAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deleteUser(username username: String, completion: ((error: ErrorType?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - completion(error: error) + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + completion(error: error); } } @@ -196,12 +198,12 @@ public class UserAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -215,7 +217,7 @@ public class UserAPI: APIBase { */ public class func getUserByName(username username: String, completion: ((data: User?, error: ErrorType?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -248,7 +250,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -257,7 +259,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", @@ -267,7 +269,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -276,7 +278,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -}] +, statusCode=200}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder @@ -286,12 +288,12 @@ public class UserAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -306,7 +308,7 @@ public class UserAPI: APIBase { */ public class func loginUser(username username: String? = nil, password: String? = nil, completion: ((data: String?, error: ErrorType?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -340,15 +342,15 @@ public class UserAPI: APIBase { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "username": username, "password": password ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -360,8 +362,8 @@ public class UserAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func logoutUser(completion: ((error: ErrorType?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - completion(error: error) + logoutUserWithRequestBuilder().execute { (response, error) -> Void in + completion(error: error); } } @@ -372,7 +374,7 @@ public class UserAPI: APIBase { */ public class func logoutUser() -> Promise { let deferred = Promise.pendingPromise() - logoutUser { error in + logoutUser() { error in if let error = error { deferred.reject(error) } else { @@ -391,12 +393,12 @@ public class UserAPI: APIBase { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -406,12 +408,12 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (_, error) -> Void in - completion(error: error) + public class func updateUser(username username: String, body: User? = nil, completion: ((error: ErrorType?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + completion(error: error); } } @@ -419,12 +421,12 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - returns: Promise */ - public class func updateUser(username username: String, user: User? = nil) -> Promise { + public class func updateUser(username username: String, body: User? = nil) -> Promise { let deferred = Promise.pendingPromise() - updateUser(username: username, user: user) { error in + updateUser(username: username, body: body) { error in if let error = error { deferred.reject(error) } else { @@ -438,18 +440,18 @@ public class UserAPI: APIBase { Updated user - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - returns: RequestBuilder */ - public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { + public class func updateUserWithRequestBuilder(username username: String, body: User? = nil) -> RequestBuilder { var path = "/user/{username}" path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 38e0a086d733..6752df2dfc01 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -41,7 +41,7 @@ public struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() class AlamofireRequestBuilder: RequestBuilder { - required init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { + required init(method: String, URLString: String, parameters: [String : AnyObject]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift index eaa10fa3763c..5911dd589c09 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -51,7 +51,7 @@ extension Array: JSONEncodable { extension Dictionary: JSONEncodable { func encodeToJSON() -> AnyObject { - var dictionary = [NSObject: AnyObject]() + var dictionary = [NSObject:AnyObject]() for (key, value) in self { dictionary[key as! NSObject] = encodeIfPossible(value) } @@ -115,7 +115,7 @@ public final class ISOFullDate: CustomStringConvertible { [ .Year, .Month, - .Day + .Day, ], fromDate: date ) @@ -178,7 +178,7 @@ extension ISOFullDate: JSONEncodable { } extension RequestBuilder { - public func execute() -> Promise> { + public func execute() -> Promise> { let deferred = Promise>.pendingPromise() self.execute { (response: Response?, error: ErrorType?) in if let response = response { diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift index 774bb1737b7d..37d49d13e22e 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> AnyObject } -public enum ErrorResponse: ErrorType { +public enum ErrorResponse : ErrorType { case Error(Int, NSData?, ErrorType) } @@ -27,7 +27,7 @@ public class Response { public convenience init(response: NSHTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } @@ -37,7 +37,7 @@ public class Response { private var once = dispatch_once_t() class Decoders { - static private var decoders = [String: ((AnyObject) -] AnyObject)>() + static private var decoders = Dictionary AnyObject)>() static func addDecoder(clazz clazz: T.Type, decoder: ((AnyObject) -> T)) { let key = "\(T.self)" @@ -49,9 +49,9 @@ class Decoders { return array.map { Decoders.decode(clazz: T.self, source: $0) } } - static func decode(clazz clazz: [Key: T].Type, source: AnyObject) -> [Key: T] { + static func decode(clazz clazz: [Key:T].Type, source: AnyObject) -> [Key:T] { let sourceDictionary = source as! [Key: AnyObject] - var dictionary = [Key: T]() + var dictionary = [Key:T]() for (key, value) in sourceDictionary { dictionary[key] = Decoders.decode(clazz: T.self, source: value) } @@ -61,10 +61,10 @@ class Decoders { static func decode(clazz clazz: T.Type, source: AnyObject) -> T { initialize() if T.self is Int32.Type && source is NSNumber { - return source.intValue as! T + return source.intValue as! T; } if T.self is Int64.Type && source is NSNumber { - return source.longLongValue as! T + return source.longLongValue as! T; } if T.self is NSUUID.Type && source is String { return NSUUID(UUIDString: source as! String) as! T @@ -102,11 +102,11 @@ class Decoders { } } - static func decodeOptional(clazz clazz: [Key: T].Type, source: AnyObject?) -> [Key: T]? { + static func decodeOptional(clazz clazz: [Key:T].Type, source: AnyObject?) -> [Key:T]? { if source is NSNull { return nil } - return source.map { (someSource: AnyObject) -> [Key: T] in + return source.map { (someSource: AnyObject) -> [Key:T] in Decoders.decode(clazz: clazz, source: someSource) } } @@ -121,7 +121,7 @@ class Decoders { "yyyy-MM-dd'T'HH:mm:ss.SSS" ].map { (format: String) -> NSDateFormatter in let formatter = NSDateFormatter() - formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") + formatter.locale = NSLocale(localeIdentifier:"en_US_POSIX") formatter.dateFormat = format return formatter } @@ -149,7 +149,7 @@ class Decoders { return isoDate } fatalError("formatter failed to parse \(source)") - }) + }) // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject) -> [Category] in @@ -157,67 +157,71 @@ class Decoders { } // Decoder for Category Decoders.addDecoder(clazz: Category.self) { (source: AnyObject) -> Category in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = Category() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) return instance } + // Decoder for [Order] Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject) -> [Order] in return Decoders.decode(clazz: [Order].self, source: source) } // Decoder for Order Decoders.addDecoder(clazz: Order.self) { (source: AnyObject) -> Order in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = Order() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.petId = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"]) instance.quantity = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"]) instance.shipDate = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["shipDate"]) - instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") instance.complete = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"]) return instance } + // Decoder for [Pet] Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject) -> [Pet] in return Decoders.decode(clazz: [Pet].self, source: source) } // Decoder for Pet Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject) -> Pet in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = Pet() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.category = Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"]) instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"]) - instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") return instance } + // Decoder for [Tag] Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject) -> [Tag] in return Decoders.decode(clazz: [Tag].self, source: source) } // Decoder for Tag Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject) -> Tag in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = Tag() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) return instance } + // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject) -> [User] in return Decoders.decode(clazz: [User].self, source: source) } // Decoder for User Decoders.addDecoder(clazz: User.self) { (source: AnyObject) -> User in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = User() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.username = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"]) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index b3cbea28b69b..ea5e47f3cfd4 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,6 +7,7 @@ import Foundation + public class Category: JSONEncodable { public var id: Int64? public var name: String? @@ -15,10 +16,10 @@ public class Category: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index bb7860b9483f..90dfd9412255 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,8 +7,9 @@ import Foundation + public class Order: JSONEncodable { - public enum Status: String { + public enum Status: String { case Placed = "placed" case Approved = "approved" case Delivered = "delivered" @@ -25,14 +26,14 @@ public class Order: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["petId"] = self.petId?.encodeToJSON() nillableDictionary["quantity"] = self.quantity?.encodeToJSON() nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() nillableDictionary["status"] = self.status?.rawValue nillableDictionary["complete"] = self.complete - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 5fa39ec431a4..f24e12684e2b 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,8 +7,9 @@ import Foundation + public class Pet: JSONEncodable { - public enum Status: String { + public enum Status: String { case Available = "available" case Pending = "pending" case Sold = "sold" @@ -25,14 +26,14 @@ public class Pet: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["category"] = self.category?.encodeToJSON() nillableDictionary["name"] = self.name nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() nillableDictionary["tags"] = self.tags?.encodeToJSON() nillableDictionary["status"] = self.status?.rawValue - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index df2d12e84fc1..d79d8df25ec9 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,6 +7,7 @@ import Foundation + public class Tag: JSONEncodable { public var id: Int64? public var name: String? @@ -15,10 +16,10 @@ public class Tag: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift index d24a21544177..c4032cd38698 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,6 +7,7 @@ import Foundation + public class User: JSONEncodable { public var id: Int64? public var username: String? @@ -22,7 +23,7 @@ public class User: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["username"] = self.username nillableDictionary["firstName"] = self.firstName @@ -31,7 +32,7 @@ public class User: JSONEncodable { nillableDictionary["password"] = self.password nillableDictionary["phone"] = self.phone nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/promisekit/git_push.sh b/samples/client/petstore/swift/promisekit/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/swift/promisekit/git_push.sh +++ b/samples/client/petstore/swift/promisekit/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -28,7 +34,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION index 6d94c9c2e12a..bfbf77eb7fad 100644 --- a/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION +++ b/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index bff5744506d7..2e354e541811 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -5,8 +5,8 @@ // class APIHelper { - static func rejectNil(source: [String: AnyObject?]) -> [String: AnyObject]? { - var destination = [String: AnyObject]() + static func rejectNil(source: [String:AnyObject?]) -> [String:AnyObject]? { + var destination = [String:AnyObject]() for (key, nillableValue) in source { if let value: AnyObject = nillableValue { destination[key] = value @@ -19,8 +19,8 @@ class APIHelper { return destination } - static func rejectNilHeaders(source: [String: AnyObject?]) -> [String: String] { - var destination = [String: String]() + static func rejectNilHeaders(source: [String:AnyObject?]) -> [String:String] { + var destination = [String:String]() for (key, nillableValue) in source { if let value: AnyObject = nillableValue { destination[key] = "\(value)" @@ -29,11 +29,11 @@ class APIHelper { return destination } - static func convertBoolToString(source: [String: AnyObject]?) -> [String: AnyObject]? { + static func convertBoolToString(source: [String: AnyObject]?) -> [String:AnyObject]? { guard let source = source else { return nil } - var destination = [String: AnyObject]() + var destination = [String:AnyObject]() let theTrue = NSNumber(bool: true) let theFalse = NSNumber(bool: false) for (key, value) in source { diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift index 676a325d49a0..1c2511ded518 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,7 +9,7 @@ import Foundation public class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io/v2" public static var credential: NSURLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } @@ -18,44 +18,44 @@ public class APIBase { let encoded: AnyObject? = encodable?.encodeToJSON() if encoded! is [AnyObject] { - var dictionary = [String: AnyObject]() + var dictionary = [String:AnyObject]() for (index, item) in (encoded as! [AnyObject]).enumerate() { dictionary["\(index)"] = item } return dictionary } else { - return encoded as? [String: AnyObject] + return encoded as? [String:AnyObject] } } } public class RequestBuilder { var credential: NSURLCredential? - var headers: [String: String] - let parameters: [String: AnyObject]? + var headers: [String:String] + let parameters: [String:AnyObject]? let isBody: Bool let method: String let URLString: String - + /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((NSProgress) -> Void)? + public var onProgressReady: ((NSProgress) -> ())? - required public init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:AnyObject]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters self.isBody = isBody self.headers = headers - + addHeaders(PetstoreClientAPI.customHeaders) } - - public func addHeaders(aHeaders: [String: String]) { + + public func addHeaders(aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } } - + public func execute(completion: (response: Response?, error: ErrorType?) -> Void) { } public func addHeader(name name: String, value: String) -> Self { @@ -64,7 +64,7 @@ public class RequestBuilder { } return self } - + public func addCredential() -> Self { self.credential = PetstoreClientAPI.credential return self @@ -74,3 +74,4 @@ public class RequestBuilder { protocol RequestBuilderFactory { func getBuilder() -> RequestBuilder.Type } + diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 866607dc04fa..3ac74dad3240 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,28 +8,30 @@ import Alamofire import RxSwift + + public class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in - completion(error: error) + public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: Observable */ - public class func addPet(pet pet: Pet? = nil) -> Observable { + public class func addPet(body body: Pet? = nil) -> Observable { return Observable.create { observer -> Disposable in - addPet(pet: pet) { error in + addPet(body: body) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -46,17 +48,17 @@ public class PetAPI: APIBase { - POST /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { + public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -70,8 +72,8 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deletePet(petId petId: Int64, apiKey: String? = nil, completion: ((error: ErrorType?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - completion(error: error) + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + completion(error: error); } } @@ -111,16 +113,16 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) let nillableHeaders: [String: AnyObject?] = [ "api_key": apiKey ] let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true, headers: headerParameters) @@ -134,7 +136,7 @@ public class PetAPI: APIBase { */ public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -180,7 +182,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -189,7 +191,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -206,7 +208,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -215,7 +217,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter status: (query) Status values that need to be considered for filter (optional) - returns: RequestBuilder<[Pet]> @@ -224,14 +226,14 @@ public class PetAPI: APIBase { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "status": status ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -245,7 +247,7 @@ public class PetAPI: APIBase { */ public class func findPetsByTags(tags tags: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -291,7 +293,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -300,7 +302,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -317,7 +319,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -326,7 +328,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter tags: (query) Tags to filter by (optional) - returns: RequestBuilder<[Pet]> @@ -335,14 +337,14 @@ public class PetAPI: APIBase { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "tags": tags ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -356,7 +358,7 @@ public class PetAPI: APIBase { */ public class func getPetById(petId petId: Int64, completion: ((data: Pet?, error: ErrorType?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -405,7 +407,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -414,7 +416,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -431,7 +433,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 doggie @@ -440,7 +442,7 @@ public class PetAPI: APIBase { aeiou -}] +, statusCode=200}] - parameter petId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -450,12 +452,12 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -464,24 +466,24 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in - completion(error: error) + public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: Observable */ - public class func updatePet(pet pet: Pet? = nil) -> Observable { + public class func updatePet(body body: Pet? = nil) -> Observable { return Observable.create { observer -> Disposable in - updatePet(pet: pet) { error in + updatePet(body: body) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -498,17 +500,17 @@ public class PetAPI: APIBase { - PUT /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) + - parameter body: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { + public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -523,8 +525,8 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - completion(error: error) + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + completion(error: error); } } @@ -566,15 +568,15 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "name": name, "status": status ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -589,8 +591,8 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil, completion: ((error: ErrorType?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (_, error) -> Void in - completion(error: error) + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in + completion(error: error); } } @@ -632,15 +634,15 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "additionalMetadata": additionalMetadata, "file": file ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index cc8873bdd9f8..42eafcf8e6b1 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Alamofire import RxSwift + + public class StoreAPI: APIBase { /** Delete purchase order by ID @@ -16,8 +18,8 @@ public class StoreAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deleteOrder(orderId orderId: String, completion: ((error: ErrorType?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - completion(error: error) + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + completion(error: error); } } @@ -53,12 +55,12 @@ public class StoreAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -69,9 +71,9 @@ public class StoreAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ - public class func getInventory(completion: ((data: [String: Int32]?, error: ErrorType?) -> Void)) { + public class func getInventory(completion: ((data: [String:Int32]?, error: ErrorType?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -80,9 +82,9 @@ public class StoreAPI: APIBase { - returns: Observable<[String:Int32]> */ - public class func getInventory() -> Observable<[String: Int32]> { + public class func getInventory() -> Observable<[String:Int32]> { return Observable.create { observer -> Disposable in - getInventory { data, error in + getInventory() { data, error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -103,17 +105,17 @@ public class StoreAPI: APIBase { - returns: RequestBuilder<[String:Int32]> */ - public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int32]> { + public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[String: Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) } @@ -126,7 +128,7 @@ public class StoreAPI: APIBase { */ public class func getOrderById(orderId orderId: String, completion: ((data: Order?, error: ErrorType?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -160,14 +162,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -175,14 +177,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -192,12 +194,12 @@ public class StoreAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -206,24 +208,24 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet (optional) + - parameter body: (body) order placed for purchasing the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(data: response?.body, error: error); } } /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet (optional) + - parameter body: (body) order placed for purchasing the pet (optional) - returns: Observable */ - public class func placeOrder(order order: Order? = nil) -> Observable { + public class func placeOrder(body body: Order? = nil) -> Observable { return Observable.create { observer -> Disposable in - placeOrder(order: order) { data, error in + placeOrder(body: body) { data, error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -244,14 +246,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -259,25 +261,25 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -}] - - parameter order: (body) order placed for purchasing the pet (optional) +, statusCode=200}] + - parameter body: (body) order placed for purchasing the pet (optional) - returns: RequestBuilder */ - public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { + public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index fae0dd5f6eda..c0db2bfc8ea0 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,28 +8,30 @@ import Alamofire import RxSwift + + public class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object (optional) + - parameter body: (body) Created user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) + public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } /** Create user - - parameter user: (body) Created user object (optional) + - parameter body: (body) Created user object (optional) - returns: Observable */ - public class func createUser(user user: User? = nil) -> Observable { + public class func createUser(body body: User? = nil) -> Observable { return Observable.create { observer -> Disposable in - createUser(user: user) { error in + createUser(body: body) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -44,17 +46,17 @@ public class UserAPI: APIBase { /** Create user - POST /user - - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) + - This can only be done by the logged in user. - parameter body: (body) Created user object (optional) - returns: RequestBuilder */ - public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { + public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -63,24 +65,24 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) + public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - returns: Observable */ - public class func createUsersWithArrayInput(user user: [User]? = nil) -> Observable { + public class func createUsersWithArrayInput(body body: [User]? = nil) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithArrayInput(user: user) { error in + createUsersWithArrayInput(body: body) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -94,17 +96,17 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithArray - parameter user: (body) List of user object (optional) + - POST /user/createWithArray - parameter body: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { + public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -113,24 +115,24 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) + public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error: error); } } /** Creates list of users with given input array - - parameter user: (body) List of user object (optional) + - parameter body: (body) List of user object (optional) - returns: Observable */ - public class func createUsersWithListInput(user user: [User]? = nil) -> Observable { + public class func createUsersWithListInput(body body: [User]? = nil) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithListInput(user: user) { error in + createUsersWithListInput(body: body) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -144,17 +146,17 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithList - parameter user: (body) List of user object (optional) + - POST /user/createWithList - parameter body: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { + public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -167,8 +169,8 @@ public class UserAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deleteUser(username username: String, completion: ((error: ErrorType?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - completion(error: error) + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + completion(error: error); } } @@ -204,12 +206,12 @@ public class UserAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -223,7 +225,7 @@ public class UserAPI: APIBase { */ public class func getUserByName(username username: String, completion: ((data: User?, error: ErrorType?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -258,7 +260,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -267,7 +269,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -}] +, statusCode=200}] - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", @@ -277,7 +279,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}}, {contentType=application/xml, example= +}, statusCode=200}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -286,7 +288,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -}] +, statusCode=200}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder @@ -296,12 +298,12 @@ public class UserAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -316,7 +318,7 @@ public class UserAPI: APIBase { */ public class func loginUser(username username: String? = nil, password: String? = nil, completion: ((data: String?, error: ErrorType?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(data: response?.body, error: error) + completion(data: response?.body, error: error); } } @@ -352,15 +354,15 @@ public class UserAPI: APIBase { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [ + let nillableParameters: [String:AnyObject?] = [ "username": username, "password": password ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -372,8 +374,8 @@ public class UserAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func logoutUser(completion: ((error: ErrorType?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - completion(error: error) + logoutUserWithRequestBuilder().execute { (response, error) -> Void in + completion(error: error); } } @@ -384,7 +386,7 @@ public class UserAPI: APIBase { */ public class func logoutUser() -> Observable { return Observable.create { observer -> Disposable in - logoutUser { error in + logoutUser() { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -405,12 +407,12 @@ public class UserAPI: APIBase { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String: AnyObject?] = [:] - + let nillableParameters: [String:AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -420,12 +422,12 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (_, error) -> Void in - completion(error: error) + public class func updateUser(username username: String, body: User? = nil, completion: ((error: ErrorType?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + completion(error: error); } } @@ -433,12 +435,12 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - returns: Observable */ - public class func updateUser(username username: String, user: User? = nil) -> Observable { + public class func updateUser(username username: String, body: User? = nil) -> Observable { return Observable.create { observer -> Disposable in - updateUser(username: username, user: user) { error in + updateUser(username: username, body: body) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -454,18 +456,18 @@ public class UserAPI: APIBase { Updated user - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) + - parameter body: (body) Updated user object (optional) - returns: RequestBuilder */ - public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { + public class func updateUserWithRequestBuilder(username username: String, body: User? = nil) -> RequestBuilder { var path = "/user/{username}" path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - + let parameters = body?.encodeToJSON() as? [String:AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 38e0a086d733..6752df2dfc01 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -41,7 +41,7 @@ public struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() class AlamofireRequestBuilder: RequestBuilder { - required init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { + required init(method: String, URLString: String, parameters: [String : AnyObject]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 603983e248ae..c04e734a7cb8 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -50,7 +50,7 @@ extension Array: JSONEncodable { extension Dictionary: JSONEncodable { func encodeToJSON() -> AnyObject { - var dictionary = [NSObject: AnyObject]() + var dictionary = [NSObject:AnyObject]() for (key, value) in self { dictionary[key as! NSObject] = encodeIfPossible(value) } @@ -114,7 +114,7 @@ public final class ISOFullDate: CustomStringConvertible { [ .Year, .Month, - .Day + .Day, ], fromDate: date ) @@ -175,3 +175,5 @@ extension ISOFullDate: JSONEncodable { return "\(year)-\(month)-\(day)" } } + + diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift index 774bb1737b7d..37d49d13e22e 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> AnyObject } -public enum ErrorResponse: ErrorType { +public enum ErrorResponse : ErrorType { case Error(Int, NSData?, ErrorType) } @@ -27,7 +27,7 @@ public class Response { public convenience init(response: NSHTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } @@ -37,7 +37,7 @@ public class Response { private var once = dispatch_once_t() class Decoders { - static private var decoders = [String: ((AnyObject) -] AnyObject)>() + static private var decoders = Dictionary AnyObject)>() static func addDecoder(clazz clazz: T.Type, decoder: ((AnyObject) -> T)) { let key = "\(T.self)" @@ -49,9 +49,9 @@ class Decoders { return array.map { Decoders.decode(clazz: T.self, source: $0) } } - static func decode(clazz clazz: [Key: T].Type, source: AnyObject) -> [Key: T] { + static func decode(clazz clazz: [Key:T].Type, source: AnyObject) -> [Key:T] { let sourceDictionary = source as! [Key: AnyObject] - var dictionary = [Key: T]() + var dictionary = [Key:T]() for (key, value) in sourceDictionary { dictionary[key] = Decoders.decode(clazz: T.self, source: value) } @@ -61,10 +61,10 @@ class Decoders { static func decode(clazz clazz: T.Type, source: AnyObject) -> T { initialize() if T.self is Int32.Type && source is NSNumber { - return source.intValue as! T + return source.intValue as! T; } if T.self is Int64.Type && source is NSNumber { - return source.longLongValue as! T + return source.longLongValue as! T; } if T.self is NSUUID.Type && source is String { return NSUUID(UUIDString: source as! String) as! T @@ -102,11 +102,11 @@ class Decoders { } } - static func decodeOptional(clazz clazz: [Key: T].Type, source: AnyObject?) -> [Key: T]? { + static func decodeOptional(clazz clazz: [Key:T].Type, source: AnyObject?) -> [Key:T]? { if source is NSNull { return nil } - return source.map { (someSource: AnyObject) -> [Key: T] in + return source.map { (someSource: AnyObject) -> [Key:T] in Decoders.decode(clazz: clazz, source: someSource) } } @@ -121,7 +121,7 @@ class Decoders { "yyyy-MM-dd'T'HH:mm:ss.SSS" ].map { (format: String) -> NSDateFormatter in let formatter = NSDateFormatter() - formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") + formatter.locale = NSLocale(localeIdentifier:"en_US_POSIX") formatter.dateFormat = format return formatter } @@ -149,7 +149,7 @@ class Decoders { return isoDate } fatalError("formatter failed to parse \(source)") - }) + }) // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject) -> [Category] in @@ -157,67 +157,71 @@ class Decoders { } // Decoder for Category Decoders.addDecoder(clazz: Category.self) { (source: AnyObject) -> Category in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = Category() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) return instance } + // Decoder for [Order] Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject) -> [Order] in return Decoders.decode(clazz: [Order].self, source: source) } // Decoder for Order Decoders.addDecoder(clazz: Order.self) { (source: AnyObject) -> Order in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = Order() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.petId = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"]) instance.quantity = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"]) instance.shipDate = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["shipDate"]) - instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") instance.complete = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"]) return instance } + // Decoder for [Pet] Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject) -> [Pet] in return Decoders.decode(clazz: [Pet].self, source: source) } // Decoder for Pet Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject) -> Pet in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = Pet() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.category = Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"]) instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"]) - instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") return instance } + // Decoder for [Tag] Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject) -> [Tag] in return Decoders.decode(clazz: [Tag].self, source: source) } // Decoder for Tag Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject) -> Tag in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = Tag() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) return instance } + // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject) -> [User] in return Decoders.decode(clazz: [User].self, source: source) } // Decoder for User Decoders.addDecoder(clazz: User.self) { (source: AnyObject) -> User in - let sourceDictionary = source as! [NSObject: AnyObject] + let sourceDictionary = source as! [NSObject:AnyObject] let instance = User() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.username = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"]) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index b3cbea28b69b..ea5e47f3cfd4 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,6 +7,7 @@ import Foundation + public class Category: JSONEncodable { public var id: Int64? public var name: String? @@ -15,10 +16,10 @@ public class Category: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index bb7860b9483f..90dfd9412255 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,8 +7,9 @@ import Foundation + public class Order: JSONEncodable { - public enum Status: String { + public enum Status: String { case Placed = "placed" case Approved = "approved" case Delivered = "delivered" @@ -25,14 +26,14 @@ public class Order: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["petId"] = self.petId?.encodeToJSON() nillableDictionary["quantity"] = self.quantity?.encodeToJSON() nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() nillableDictionary["status"] = self.status?.rawValue nillableDictionary["complete"] = self.complete - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 5fa39ec431a4..f24e12684e2b 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,8 +7,9 @@ import Foundation + public class Pet: JSONEncodable { - public enum Status: String { + public enum Status: String { case Available = "available" case Pending = "pending" case Sold = "sold" @@ -25,14 +26,14 @@ public class Pet: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["category"] = self.category?.encodeToJSON() nillableDictionary["name"] = self.name nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() nillableDictionary["tags"] = self.tags?.encodeToJSON() nillableDictionary["status"] = self.status?.rawValue - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index df2d12e84fc1..d79d8df25ec9 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,6 +7,7 @@ import Foundation + public class Tag: JSONEncodable { public var id: Int64? public var name: String? @@ -15,10 +16,10 @@ public class Tag: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift index d24a21544177..c4032cd38698 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,6 +7,7 @@ import Foundation + public class User: JSONEncodable { public var id: Int64? public var username: String? @@ -22,7 +23,7 @@ public class User: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() + var nillableDictionary = [String:AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["username"] = self.username nillableDictionary["firstName"] = self.firstName @@ -31,7 +32,7 @@ public class User: JSONEncodable { nillableDictionary["password"] = self.password nillableDictionary["phone"] = self.phone nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/rxswift/git_push.sh b/samples/client/petstore/swift/rxswift/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/swift/rxswift/git_push.sh +++ b/samples/client/petstore/swift/rxswift/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -28,7 +34,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift3/default/.openapi-generator/VERSION b/samples/client/petstore/swift3/default/.openapi-generator/VERSION index 6d94c9c2e12a..bfbf77eb7fad 100644 --- a/samples/client/petstore/swift3/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ea37e8c5966d..e95f9ab1efaf 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -25,14 +25,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model + - To test special tags and operation ID starting with number + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index e44709f2459f..4fa62a7e183e 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -40,11 +40,11 @@ open class FakeAPI: APIBase { } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -53,13 +53,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() + let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) @@ -126,13 +126,75 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } + /** + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + - PUT /fake/body-with-file-schema + - For this test, the body for this request much reference a schema named `File`. + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { + let path = "/fake/body-with-file-schema" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + - parameter query: (query) + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -142,13 +204,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -158,7 +220,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -183,9 +245,9 @@ open class FakeAPI: APIBase { /** - 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 @@ -277,6 +339,14 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** * enum for parameter enumFormStringArray */ @@ -294,14 +364,6 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -309,13 +371,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in completion(error) } } @@ -330,18 +392,17 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -351,7 +412,8 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -364,6 +426,88 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + Fake endpoint to test group parameters (optional) + - DELETE /fake + - Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: RequestBuilder + */ + open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), + "int64_group": int64Group?.encodeToJSON() + ]) + let nillableHeaders: [String: Any?] = [ + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter param: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = param.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 20514a3b6e6b..79a28854094c 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -12,11 +12,11 @@ import Alamofire open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -29,13 +29,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 8648214c7309..495468f63e35 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -28,13 +28,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -207,11 +207,11 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -223,13 +223,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -330,4 +330,50 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { + uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + uploads an image (required) + - POST /fake/{petId}/uploadImageWithRequiredFile + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { + var path = "/fake/{petId}/uploadImageWithRequiredFile" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + } diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 66dbd6f25d8c..84cea5213bab 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -112,11 +112,11 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -125,13 +125,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index eee28ea249ac..7abdf0b76cd7 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -26,13 +26,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -43,11 +43,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -56,13 +56,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -73,11 +73,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -86,13 +86,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -137,7 +137,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -150,7 +150,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -236,11 +236,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error) } } @@ -251,16 +251,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift index d1465fe4cbe4..264241b7d139 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,15 +297,15 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { - case let .success(value): _result.mapProperty = value + case let .success(value): _result.mapString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { - case let .success(value): _result.mapOfMapProperty = value + case let .success(value): _result.mapMapString = value case let .failure(error): break } @@ -533,6 +533,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } + // Decoder for [CatAllOf] + Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in + return Decoders.decode(clazz: [CatAllOf].self, source: source) + } + + // Decoder for CatAllOf + Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? CatAllOf() : instance as! CatAllOf + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + + case let .success(value): _result.declawed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -634,6 +654,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } + // Decoder for [DogAllOf] + Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in + return Decoders.decode(clazz: [DogAllOf].self, source: source) + } + + // Decoder for DogAllOf + Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? DogAllOf() : instance as! DogAllOf + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + + case let .success(value): _result.breed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -684,6 +724,12 @@ class Decoders { case let .success(value): _result.enumString = value case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: EnumTest.EnumStringRequired.self, source: sourceDictionary["enum_string_required"] as AnyObject?) { + + case let .success(value): _result.enumStringRequired = value + case let .failure(error): break + } switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { @@ -708,6 +754,52 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } + // Decoder for [File] + Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in + return Decoders.decode(clazz: [File].self, source: source) + } + + // Decoder for File + Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? File() : instance as! File + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { + + case let .success(value): _result.sourceURI = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "File", actual: "\(source)")) + } + } + // Decoder for [FileSchemaTestClass] + Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in + return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) + } + + // Decoder for FileSchemaTestClass + Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? FileSchemaTestClass() : instance as! FileSchemaTestClass + switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { + + case let .success(value): _result.file = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { + + case let .success(value): _result.files = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) + } + } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -866,6 +958,18 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break */ default: break //TODO: handle enum map scenario + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { + + case let .success(value): _result.directMap = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { + + case let .success(value): _result.indirectMap = value + case let .failure(error): break + } return .success(_result) } else { @@ -1222,6 +1326,94 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } + // Decoder for [TypeHolderDefault] + Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in + return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) + } + + // Decoder for TypeHolderDefault + Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderDefault() : instance as! TypeHolderDefault + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) + } + } + // Decoder for [TypeHolderExample] + Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in + return Decoders.decode(clazz: [TypeHolderExample].self, source: source) + } + + // Decoder for TypeHolderExample + Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderExample() : instance as! TypeHolderExample + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) + } + } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 48724b45a3d2..18238c78e35e 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,16 +10,16 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() + nillableDictionary["map_string"] = self.mapString?.encodeToJSON() + nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 59c0660b900d..0478bff2d394 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,6 +15,11 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } + public enum EnumStringRequired: String { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -24,6 +29,7 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? @@ -34,6 +40,7 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue + nillableDictionary["enum_string_required"] = self.enumStringRequired?.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 7b6af62b0576..bbc87e81cc75 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,6 +16,8 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? + public var indirectMap: [String:Bool]? public init() {} @@ -23,6 +25,8 @@ open class MapTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario + nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() + nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/default/git_push.sh b/samples/client/petstore/swift3/default/git_push.sh index 20057f67ade4..ced3be2b0c7b 100644 --- a/samples/client/petstore/swift3/default/git_push.sh +++ b/samples/client/petstore/swift3/default/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION index 6d94c9c2e12a..bfbf77eb7fad 100644 --- a/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ea37e8c5966d..e95f9ab1efaf 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -25,14 +25,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model + - To test special tags and operation ID starting with number + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index e44709f2459f..4fa62a7e183e 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -40,11 +40,11 @@ open class FakeAPI: APIBase { } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -53,13 +53,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() + let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) @@ -126,13 +126,75 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } + /** + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + - PUT /fake/body-with-file-schema + - For this test, the body for this request much reference a schema named `File`. + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { + let path = "/fake/body-with-file-schema" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + - parameter query: (query) + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -142,13 +204,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -158,7 +220,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -183,9 +245,9 @@ open class FakeAPI: APIBase { /** - 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 @@ -277,6 +339,14 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** * enum for parameter enumFormStringArray */ @@ -294,14 +364,6 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -309,13 +371,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in completion(error) } } @@ -330,18 +392,17 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -351,7 +412,8 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -364,6 +426,88 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + Fake endpoint to test group parameters (optional) + - DELETE /fake + - Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: RequestBuilder + */ + open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), + "int64_group": int64Group?.encodeToJSON() + ]) + let nillableHeaders: [String: Any?] = [ + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter param: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = param.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 20514a3b6e6b..79a28854094c 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -12,11 +12,11 @@ import Alamofire open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -29,13 +29,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 8648214c7309..495468f63e35 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -28,13 +28,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -207,11 +207,11 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -223,13 +223,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -330,4 +330,50 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { + uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + uploads an image (required) + - POST /fake/{petId}/uploadImageWithRequiredFile + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { + var path = "/fake/{petId}/uploadImageWithRequiredFile" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + } diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 66dbd6f25d8c..84cea5213bab 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -112,11 +112,11 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -125,13 +125,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index eee28ea249ac..7abdf0b76cd7 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -26,13 +26,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -43,11 +43,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -56,13 +56,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -73,11 +73,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -86,13 +86,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -137,7 +137,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -150,7 +150,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -236,11 +236,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error) } } @@ -251,16 +251,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index d1465fe4cbe4..264241b7d139 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,15 +297,15 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { - case let .success(value): _result.mapProperty = value + case let .success(value): _result.mapString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { - case let .success(value): _result.mapOfMapProperty = value + case let .success(value): _result.mapMapString = value case let .failure(error): break } @@ -533,6 +533,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } + // Decoder for [CatAllOf] + Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in + return Decoders.decode(clazz: [CatAllOf].self, source: source) + } + + // Decoder for CatAllOf + Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? CatAllOf() : instance as! CatAllOf + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + + case let .success(value): _result.declawed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -634,6 +654,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } + // Decoder for [DogAllOf] + Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in + return Decoders.decode(clazz: [DogAllOf].self, source: source) + } + + // Decoder for DogAllOf + Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? DogAllOf() : instance as! DogAllOf + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + + case let .success(value): _result.breed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -684,6 +724,12 @@ class Decoders { case let .success(value): _result.enumString = value case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: EnumTest.EnumStringRequired.self, source: sourceDictionary["enum_string_required"] as AnyObject?) { + + case let .success(value): _result.enumStringRequired = value + case let .failure(error): break + } switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { @@ -708,6 +754,52 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } + // Decoder for [File] + Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in + return Decoders.decode(clazz: [File].self, source: source) + } + + // Decoder for File + Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? File() : instance as! File + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { + + case let .success(value): _result.sourceURI = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "File", actual: "\(source)")) + } + } + // Decoder for [FileSchemaTestClass] + Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in + return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) + } + + // Decoder for FileSchemaTestClass + Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? FileSchemaTestClass() : instance as! FileSchemaTestClass + switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { + + case let .success(value): _result.file = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { + + case let .success(value): _result.files = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) + } + } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -866,6 +958,18 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break */ default: break //TODO: handle enum map scenario + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { + + case let .success(value): _result.directMap = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { + + case let .success(value): _result.indirectMap = value + case let .failure(error): break + } return .success(_result) } else { @@ -1222,6 +1326,94 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } + // Decoder for [TypeHolderDefault] + Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in + return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) + } + + // Decoder for TypeHolderDefault + Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderDefault() : instance as! TypeHolderDefault + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) + } + } + // Decoder for [TypeHolderExample] + Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in + return Decoders.decode(clazz: [TypeHolderExample].self, source: source) + } + + // Decoder for TypeHolderExample + Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderExample() : instance as! TypeHolderExample + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) + } + } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 48724b45a3d2..18238c78e35e 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,16 +10,16 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() + nillableDictionary["map_string"] = self.mapString?.encodeToJSON() + nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 59c0660b900d..0478bff2d394 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,6 +15,11 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } + public enum EnumStringRequired: String { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -24,6 +29,7 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? @@ -34,6 +40,7 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue + nillableDictionary["enum_string_required"] = self.enumStringRequired?.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 099ecb1da5e6..b5533babdd4c 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -29,11 +29,6 @@ open class FormatTest: JSONEncodable { } } public var number: Double? - public var numberNum: NSNumber? { - get { - return number.map({ return NSNumber(value: $0) }) - } - } public var float: Float? public var floatNum: NSNumber? { get { diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 7b6af62b0576..bbc87e81cc75 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,6 +16,8 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? + public var indirectMap: [String:Bool]? public init() {} @@ -23,6 +25,8 @@ open class MapTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario + nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() + nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 342d6796d8d9..bbcf6dc330cd 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,11 +11,6 @@ import Foundation open class NumberOnly: JSONEncodable { public var justNumber: Double? - public var justNumberNum: NSNumber? { - get { - return justNumber.map({ return NSNumber(value: $0) }) - } - } public init() {} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index ba3fa230f344..2ffa447b561e 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -11,11 +11,6 @@ import Foundation open class OuterComposite: JSONEncodable { public var myNumber: Double? - public var myNumberNum: NSNumber? { - get { - return myNumber.map({ return NSNumber(value: $0) }) - } - } public var myString: String? public var myBoolean: Bool? public var myBooleanNum: NSNumber? { diff --git a/samples/client/petstore/swift3/objcCompatible/git_push.sh b/samples/client/petstore/swift3/objcCompatible/git_push.sh index 20057f67ade4..ced3be2b0c7b 100644 --- a/samples/client/petstore/swift3/objcCompatible/git_push.sh +++ b/samples/client/petstore/swift3/objcCompatible/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION index 6d94c9c2e12a..bfbf77eb7fad 100644 --- a/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 1c087005acac..9fbe015fba16 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -13,23 +13,23 @@ import PromiseKit open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - returns: Promise */ - open class func testSpecialTags( client: Client) -> Promise { + open class func call123testSpecialTags( body: Client) -> Promise { let deferred = Promise.pending() - testSpecialTags(client: client) { data, error in + call123testSpecialTags(body: body) { data, error in if let error = error { deferred.reject(error) } else { @@ -42,14 +42,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model + - To test special tags and operation ID starting with number + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index d9ab85604de4..736e2079c38e 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -56,22 +56,22 @@ open class FakeAPI: APIBase { } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: Promise */ - open class func fakeOuterCompositeSerialize( outerComposite: OuterComposite? = nil) -> Promise { + open class func fakeOuterCompositeSerialize( body: OuterComposite? = nil) -> Promise { let deferred = Promise.pending() - fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in + fakeOuterCompositeSerialize(body: body) { data, error in if let error = error { deferred.reject(error) } else { @@ -84,13 +84,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() + let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) @@ -187,25 +187,118 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } + /** + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error) + } + } + + /** + - parameter body: (body) + - returns: Promise + */ + open class func testBodyWithFileSchema( body: FileSchemaTestClass) -> Promise { + let deferred = Promise.pending() + testBodyWithFileSchema(body: body) { error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill() + } + } + return deferred.promise + } + + /** + - PUT /fake/body-with-file-schema + - For this test, the body for this request much reference a schema named `File`. + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { + let path = "/fake/body-with-file-schema" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + - parameter query: (query) + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + completion(error) + } + } + + /** + - parameter query: (query) + - parameter body: (body) + - returns: Promise + */ + open class func testBodyWithQueryParams( query: String, body: User) -> Promise { + let deferred = Promise.pending() + testBodyWithQueryParams(query: query, body: body) { error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill() + } + } + return deferred.promise + } + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: Promise */ - open class func testClientModel( client: Client) -> Promise { + open class func testClientModel( body: Client) -> Promise { let deferred = Promise.pending() - testClientModel(client: client) { data, error in + testClientModel(body: body) { data, error in if let error = error { deferred.reject(error) } else { @@ -219,13 +312,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -235,7 +328,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -259,7 +352,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -289,9 +382,9 @@ open class FakeAPI: APIBase { } /** - 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 @@ -383,6 +476,14 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** * enum for parameter enumFormStringArray */ @@ -400,14 +501,6 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -415,13 +508,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in completion(error) } } @@ -433,14 +526,14 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: Promise */ - open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> Promise { + open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise { let deferred = Promise.pending() - testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble) { error in + testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { error in if let error = error { deferred.reject(error) } else { @@ -459,18 +552,17 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -480,7 +572,8 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -493,6 +586,125 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + completion(error) + } + } + + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: Promise + */ + open class func testGroupParameters( requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Promise { + let deferred = Promise.pending() + testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group) { error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill() + } + } + return deferred.promise + } + + /** + Fake endpoint to test group parameters (optional) + - DELETE /fake + - Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: RequestBuilder + */ + open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), + "int64_group": int64Group?.encodeToJSON() + ]) + let nillableHeaders: [String: Any?] = [ + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + completion(error) + } + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - returns: Promise + */ + open class func testInlineAdditionalProperties( param: [String:String]) -> Promise { + let deferred = Promise.pending() + testInlineAdditionalProperties(param: param) { error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill() + } + } + return deferred.promise + } + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter param: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = param.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 7bf28fcfb2c5..ca9038656923 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -13,23 +13,23 @@ import PromiseKit open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - returns: Promise */ - open class func testClassname( client: Client) -> Promise { + open class func testClassname( body: Client) -> Promise { let deferred = Promise.pending() - testClassname(client: client) { data, error in + testClassname(body: body) { data, error in if let error = error { deferred.reject(error) } else { @@ -46,13 +46,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 36338aafb974..2a938c60474e 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -13,23 +13,23 @@ import PromiseKit open class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: Promise */ - open class func addPet( pet: Pet) -> Promise { + open class func addPet( body: Pet) -> Promise { let deferred = Promise.pending() - addPet(pet: pet) { error in + addPet(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -45,13 +45,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -289,23 +289,23 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: Promise */ - open class func updatePet( pet: Pet) -> Promise { + open class func updatePet( body: Pet) -> Promise { let deferred = Promise.pending() - updatePet(pet: pet) { error in + updatePet(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -321,13 +321,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -464,4 +464,68 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { + uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: Promise + */ + open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Promise { + let deferred = Promise.pending() + uploadFileWithRequiredFile(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } + + /** + uploads an image (required) + - POST /fake/{petId}/uploadImageWithRequiredFile + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { + var path = "/fake/{petId}/uploadImageWithRequiredFile" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + } diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 67fe5e9bacf8..7bbc30fa301c 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -160,23 +160,23 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: Promise */ - open class func placeOrder( order: Order) -> Promise { + open class func placeOrder( body: Order) -> Promise { let deferred = Promise.pending() - placeOrder(order: order) { data, error in + placeOrder(body: body) { data, error in if let error = error { deferred.reject(error) } else { @@ -189,13 +189,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 90a131ebe8b8..a4b01fb86bed 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -13,23 +13,23 @@ import PromiseKit open class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: Promise */ - open class func createUser( user: User) -> Promise { + open class func createUser( body: User) -> Promise { let deferred = Promise.pending() - createUser(user: user) { error in + createUser(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -43,13 +43,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -60,23 +60,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: Promise */ - open class func createUsersWithArrayInput( user: [User]) -> Promise { + open class func createUsersWithArrayInput( body: [User]) -> Promise { let deferred = Promise.pending() - createUsersWithArrayInput(user: user) { error in + createUsersWithArrayInput(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -89,13 +89,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -106,23 +106,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: Promise */ - open class func createUsersWithListInput( user: [User]) -> Promise { + open class func createUsersWithListInput( body: [User]) -> Promise { let deferred = Promise.pending() - createUsersWithListInput(user: user) { error in + createUsersWithListInput(body: body) { error in if let error = error { deferred.reject(error) } else { @@ -135,13 +135,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -202,7 +202,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -213,7 +213,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: Promise */ open class func getUserByName( username: String) -> Promise { @@ -231,7 +231,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -349,11 +349,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error) } } @@ -361,12 +361,12 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: Promise */ - open class func updateUser( username: String, user: User) -> Promise { + open class func updateUser( username: String, body: User) -> Promise { let deferred = Promise.pending() - updateUser(username: username, user: user) { error in + updateUser(username: username, body: body) { error in if let error = error { deferred.reject(error) } else { @@ -381,16 +381,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift index d1465fe4cbe4..264241b7d139 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,15 +297,15 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { - case let .success(value): _result.mapProperty = value + case let .success(value): _result.mapString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { - case let .success(value): _result.mapOfMapProperty = value + case let .success(value): _result.mapMapString = value case let .failure(error): break } @@ -533,6 +533,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } + // Decoder for [CatAllOf] + Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in + return Decoders.decode(clazz: [CatAllOf].self, source: source) + } + + // Decoder for CatAllOf + Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? CatAllOf() : instance as! CatAllOf + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + + case let .success(value): _result.declawed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -634,6 +654,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } + // Decoder for [DogAllOf] + Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in + return Decoders.decode(clazz: [DogAllOf].self, source: source) + } + + // Decoder for DogAllOf + Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? DogAllOf() : instance as! DogAllOf + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + + case let .success(value): _result.breed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -684,6 +724,12 @@ class Decoders { case let .success(value): _result.enumString = value case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: EnumTest.EnumStringRequired.self, source: sourceDictionary["enum_string_required"] as AnyObject?) { + + case let .success(value): _result.enumStringRequired = value + case let .failure(error): break + } switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { @@ -708,6 +754,52 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } + // Decoder for [File] + Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in + return Decoders.decode(clazz: [File].self, source: source) + } + + // Decoder for File + Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? File() : instance as! File + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { + + case let .success(value): _result.sourceURI = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "File", actual: "\(source)")) + } + } + // Decoder for [FileSchemaTestClass] + Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in + return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) + } + + // Decoder for FileSchemaTestClass + Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? FileSchemaTestClass() : instance as! FileSchemaTestClass + switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { + + case let .success(value): _result.file = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { + + case let .success(value): _result.files = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) + } + } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -866,6 +958,18 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break */ default: break //TODO: handle enum map scenario + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { + + case let .success(value): _result.directMap = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { + + case let .success(value): _result.indirectMap = value + case let .failure(error): break + } return .success(_result) } else { @@ -1222,6 +1326,94 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } + // Decoder for [TypeHolderDefault] + Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in + return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) + } + + // Decoder for TypeHolderDefault + Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderDefault() : instance as! TypeHolderDefault + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) + } + } + // Decoder for [TypeHolderExample] + Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in + return Decoders.decode(clazz: [TypeHolderExample].self, source: source) + } + + // Decoder for TypeHolderExample + Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderExample() : instance as! TypeHolderExample + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) + } + } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 48724b45a3d2..18238c78e35e 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,16 +10,16 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() + nillableDictionary["map_string"] = self.mapString?.encodeToJSON() + nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 59c0660b900d..0478bff2d394 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,6 +15,11 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } + public enum EnumStringRequired: String { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -24,6 +29,7 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? @@ -34,6 +40,7 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue + nillableDictionary["enum_string_required"] = self.enumStringRequired?.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 7b6af62b0576..bbc87e81cc75 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,6 +16,8 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? + public var indirectMap: [String:Bool]? public init() {} @@ -23,6 +25,8 @@ open class MapTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario + nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() + nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/promisekit/git_push.sh b/samples/client/petstore/swift3/promisekit/git_push.sh index 20057f67ade4..ced3be2b0c7b 100644 --- a/samples/client/petstore/swift3/promisekit/git_push.sh +++ b/samples/client/petstore/swift3/promisekit/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION index 6d94c9c2e12a..bfbf77eb7fad 100644 --- a/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index c468f8a38288..be4174fd49bb 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -13,23 +13,23 @@ import RxSwift open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - returns: Observable */ - open class func testSpecialTags(client: Client) -> Observable { + open class func call123testSpecialTags(body: Client) -> Observable { return Observable.create { observer -> Disposable in - testSpecialTags(client: client) { data, error in + call123testSpecialTags(body: body) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -44,14 +44,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model + - To test special tags and operation ID starting with number + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 9197924fff87..39a4d8062cce 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -58,22 +58,22 @@ open class FakeAPI: APIBase { } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: Observable */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil) -> Observable { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil) -> Observable { return Observable.create { observer -> Disposable in - fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in + fakeOuterCompositeSerialize(body: body) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -88,13 +88,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() + let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) @@ -195,25 +195,122 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } + /** + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error) + } + } + + /** + - parameter body: (body) + - returns: Observable + */ + open class func testBodyWithFileSchema(body: FileSchemaTestClass) -> Observable { + return Observable.create { observer -> Disposable in + testBodyWithFileSchema(body: body) { error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next()) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - PUT /fake/body-with-file-schema + - For this test, the body for this request much reference a schema named `File`. + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { + let path = "/fake/body-with-file-schema" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + - parameter query: (query) + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + completion(error) + } + } + + /** + - parameter query: (query) + - parameter body: (body) + - returns: Observable + */ + open class func testBodyWithQueryParams(query: String, body: User) -> Observable { + return Observable.create { observer -> Disposable in + testBodyWithQueryParams(query: query, body: body) { error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next()) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: Observable */ - open class func testClientModel(client: Client) -> Observable { + open class func testClientModel(body: Client) -> Observable { return Observable.create { observer -> Disposable in - testClientModel(client: client) { data, error in + testClientModel(body: body) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -229,13 +326,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -245,7 +342,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -269,7 +366,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -301,9 +398,9 @@ open class FakeAPI: APIBase { } /** - 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 @@ -395,6 +492,14 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** * enum for parameter enumFormStringArray */ @@ -412,14 +517,6 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -427,13 +524,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in completion(error) } } @@ -445,14 +542,14 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: Observable */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> Observable { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Observable { return Observable.create { observer -> Disposable in - testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble) { error in + testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -473,18 +570,17 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -494,7 +590,8 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -507,6 +604,129 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + completion(error) + } + } + + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: Observable + */ + open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Observable { + return Observable.create { observer -> Disposable in + testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group) { error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next()) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Fake endpoint to test group parameters (optional) + - DELETE /fake + - Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: RequestBuilder + */ + open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), + "int64_group": int64Group?.encodeToJSON() + ]) + let nillableHeaders: [String: Any?] = [ + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + completion(error) + } + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - returns: Observable + */ + open class func testInlineAdditionalProperties(param: [String:String]) -> Observable { + return Observable.create { observer -> Disposable in + testInlineAdditionalProperties(param: param) { error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next()) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter param: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = param.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index d2a6ecf21977..80fd6e47fd53 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -13,23 +13,23 @@ import RxSwift open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - returns: Observable */ - open class func testClassname(client: Client) -> Observable { + open class func testClassname(body: Client) -> Observable { return Observable.create { observer -> Disposable in - testClassname(client: client) { data, error in + testClassname(body: body) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -48,13 +48,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0cb25ffcbdb4..964c1ea0c06d 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -13,23 +13,23 @@ import RxSwift open class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: Observable */ - open class func addPet(pet: Pet) -> Observable { + open class func addPet(body: Pet) -> Observable { return Observable.create { observer -> Disposable in - addPet(pet: pet) { error in + addPet(body: body) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -47,13 +47,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -299,23 +299,23 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: Observable */ - open class func updatePet(pet: Pet) -> Observable { + open class func updatePet(body: Pet) -> Observable { return Observable.create { observer -> Disposable in - updatePet(pet: pet) { error in + updatePet(body: body) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -333,13 +333,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -480,4 +480,70 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { + uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: Observable + */ + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Observable { + return Observable.create { observer -> Disposable in + uploadFileWithRequiredFile(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata) { data, error in + if let error = error { + observer.on(.error(error as Error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + uploads an image (required) + - POST /fake/{petId}/uploadImageWithRequiredFile + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { + var path = "/fake/{petId}/uploadImageWithRequiredFile" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + } diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 1fc9de36c091..752f516020fd 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -166,23 +166,23 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: Observable */ - open class func placeOrder(order: Order) -> Observable { + open class func placeOrder(body: Order) -> Observable { return Observable.create { observer -> Disposable in - placeOrder(order: order) { data, error in + placeOrder(body: body) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -197,13 +197,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 0641d7201db4..8f69dfd4a4f9 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -13,23 +13,23 @@ import RxSwift open class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: Observable */ - open class func createUser(user: User) -> Observable { + open class func createUser(body: User) -> Observable { return Observable.create { observer -> Disposable in - createUser(user: user) { error in + createUser(body: body) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -45,13 +45,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -62,23 +62,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: Observable */ - open class func createUsersWithArrayInput(user: [User]) -> Observable { + open class func createUsersWithArrayInput(body: [User]) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithArrayInput(user: user) { error in + createUsersWithArrayInput(body: body) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -93,13 +93,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -110,23 +110,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: Observable */ - open class func createUsersWithListInput(user: [User]) -> Observable { + open class func createUsersWithListInput(body: [User]) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithListInput(user: user) { error in + createUsersWithListInput(body: body) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -141,13 +141,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -210,7 +210,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -221,7 +221,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: Observable */ open class func getUserByName(username: String) -> Observable { @@ -241,7 +241,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -363,11 +363,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error) } } @@ -375,12 +375,12 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: Observable */ - open class func updateUser(username: String, user: User) -> Observable { + open class func updateUser(username: String, body: User) -> Observable { return Observable.create { observer -> Disposable in - updateUser(username: username, user: user) { error in + updateUser(username: username, body: body) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -397,16 +397,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift index d1465fe4cbe4..264241b7d139 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,15 +297,15 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { - case let .success(value): _result.mapProperty = value + case let .success(value): _result.mapString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { - case let .success(value): _result.mapOfMapProperty = value + case let .success(value): _result.mapMapString = value case let .failure(error): break } @@ -533,6 +533,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } + // Decoder for [CatAllOf] + Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in + return Decoders.decode(clazz: [CatAllOf].self, source: source) + } + + // Decoder for CatAllOf + Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? CatAllOf() : instance as! CatAllOf + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + + case let .success(value): _result.declawed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -634,6 +654,26 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } + // Decoder for [DogAllOf] + Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in + return Decoders.decode(clazz: [DogAllOf].self, source: source) + } + + // Decoder for DogAllOf + Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? DogAllOf() : instance as! DogAllOf + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + + case let .success(value): _result.breed = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -684,6 +724,12 @@ class Decoders { case let .success(value): _result.enumString = value case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: EnumTest.EnumStringRequired.self, source: sourceDictionary["enum_string_required"] as AnyObject?) { + + case let .success(value): _result.enumStringRequired = value + case let .failure(error): break + } switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { @@ -708,6 +754,52 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } + // Decoder for [File] + Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in + return Decoders.decode(clazz: [File].self, source: source) + } + + // Decoder for File + Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? File() : instance as! File + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { + + case let .success(value): _result.sourceURI = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "File", actual: "\(source)")) + } + } + // Decoder for [FileSchemaTestClass] + Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in + return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) + } + + // Decoder for FileSchemaTestClass + Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? FileSchemaTestClass() : instance as! FileSchemaTestClass + switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { + + case let .success(value): _result.file = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { + + case let .success(value): _result.files = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) + } + } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -866,6 +958,18 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break */ default: break //TODO: handle enum map scenario + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { + + case let .success(value): _result.directMap = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { + + case let .success(value): _result.indirectMap = value + case let .failure(error): break + } return .success(_result) } else { @@ -1222,6 +1326,94 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } + // Decoder for [TypeHolderDefault] + Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in + return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) + } + + // Decoder for TypeHolderDefault + Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderDefault() : instance as! TypeHolderDefault + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) + } + } + // Decoder for [TypeHolderExample] + Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in + return Decoders.decode(clazz: [TypeHolderExample].self, source: source) + } + + // Decoder for TypeHolderExample + Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = instance == nil ? TypeHolderExample() : instance as! TypeHolderExample + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { + + case let .success(value): _result.stringItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { + + case let .success(value): _result.numberItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { + + case let .success(value): _result.integerItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { + + case let .success(value): _result.boolItem = value + case let .failure(error): break + + } + switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { + + case let .success(value): _result.arrayItem = value + case let .failure(error): break + + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) + } + } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 48724b45a3d2..18238c78e35e 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,16 +10,16 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() + nillableDictionary["map_string"] = self.mapString?.encodeToJSON() + nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 59c0660b900d..0478bff2d394 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,6 +15,11 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } + public enum EnumStringRequired: String { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -24,6 +29,7 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? @@ -34,6 +40,7 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue + nillableDictionary["enum_string_required"] = self.enumStringRequired?.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 7b6af62b0576..bbc87e81cc75 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,6 +16,8 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? + public var indirectMap: [String:Bool]? public init() {} @@ -23,6 +25,8 @@ open class MapTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario + nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() + nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/rxswift/git_push.sh b/samples/client/petstore/swift3/rxswift/git_push.sh index 20057f67ade4..ced3be2b0c7b 100644 --- a/samples/client/petstore/swift3/rxswift/git_push.sh +++ b/samples/client/petstore/swift3/rxswift/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION b/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION index 6d94c9c2e12a..bfbf77eb7fad 100644 --- a/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ea37e8c5966d..e95f9ab1efaf 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -25,14 +25,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model + - To test special tags and operation ID starting with number + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index e44709f2459f..4fa62a7e183e 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -40,11 +40,11 @@ open class FakeAPI: APIBase { } /** - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -53,13 +53,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) + - parameter body: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() + let parameters = body?.encodeToJSON() let url = URLComponents(string: URLString) @@ -126,13 +126,75 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } + /** + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + - PUT /fake/body-with-file-schema + - For this test, the body for this request much reference a schema named `File`. + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { + let path = "/fake/body-with-file-schema" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + - parameter query: (query) + - parameter body: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter body: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = body.encodeToJSON() + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -142,13 +204,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -158,7 +220,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -183,9 +245,9 @@ open class FakeAPI: APIBase { /** - 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 @@ -277,6 +339,14 @@ open class FakeAPI: APIBase { case number2 = -2 } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** * enum for parameter enumFormStringArray */ @@ -294,14 +364,6 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -309,13 +371,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in completion(error) } } @@ -330,18 +392,17 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_form_string": enumFormString?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -351,7 +412,8 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -364,6 +426,88 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } + /** + Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + Fake endpoint to test group parameters (optional) + - DELETE /fake + - Fake endpoint to test group parameters (optional) + - parameter requiredStringGroup: (query) Required String in group parameters + - parameter requiredBooleanGroup: (header) Required Boolean in group parameters + - parameter requiredInt64Group: (query) Required Integer in group parameters + - parameter stringGroup: (query) String in group parameters (optional) + - parameter booleanGroup: (header) Boolean in group parameters (optional) + - parameter int64Group: (query) Integer in group parameters (optional) + - returns: RequestBuilder + */ + open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String:Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), + "int64_group": int64Group?.encodeToJSON() + ]) + let nillableHeaders: [String: Any?] = [ + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + - parameter param: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + completion(error) + } + } + + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter param: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = param.encodeToJSON() + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 20514a3b6e6b..79a28854094c 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -12,11 +12,11 @@ import Alamofire open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter client: (body) client model + - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -29,13 +29,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter client: (body) client model + - parameter body: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 8648214c7309..495468f63e35 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class PetAPI: APIBase { /** Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -28,13 +28,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -207,11 +207,11 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -223,13 +223,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store + - parameter body: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -330,4 +330,50 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } + /** + uploads an image (required) + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { + uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + + /** + uploads an image (required) + - POST /fake/{petId}/uploadImageWithRequiredFile + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter requiredFile: (form) file to upload + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { + var path = "/fake/{petId}/uploadImageWithRequiredFile" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String:Any?] = [ + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + } diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 66dbd6f25d8c..84cea5213bab 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -112,11 +112,11 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -125,13 +125,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter order: (body) order placed for purchasing the pet + - parameter body: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index eee28ea249ac..7abdf0b76cd7 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class UserAPI: APIBase { /** Create user - - parameter user: (body) Created user object + - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -26,13 +26,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter user: (body) Created user object + - parameter body: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -43,11 +43,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -56,13 +56,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -73,11 +73,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter user: (body) List of user object + - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(error) } } @@ -86,13 +86,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter user: (body) List of user object + - parameter body: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) @@ -137,7 +137,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -150,7 +150,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -236,11 +236,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in completion(error) } } @@ -251,16 +251,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object + - parameter body: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() + let parameters = body.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift index ae32e6fab12c..a9eba8b46f3a 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,12 +297,12 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = AdditionalPropertiesClass() - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { - case let .success(value): _result.mapProperty = value + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { + case let .success(value): _result.mapString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { - case let .success(value): _result.mapOfMapProperty = value + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { + case let .success(value): _result.mapMapString = value case let .failure(error): break } return .success(_result) @@ -492,6 +492,24 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } + // Decoder for [CatAllOf] + Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in + return Decoders.decode(clazz: [CatAllOf].self, source: source) + } + + // Decoder for CatAllOf + Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = CatAllOf() + switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { + case let .success(value): _result.declawed = value + case let .failure(error): break + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) + } + } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -500,15 +518,17 @@ class Decoders { // Decoder for Category Decoders.addDecoder(clazz: Category.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = Category() + guard let nameSource = sourceDictionary["name"] as AnyObject? else { + return .failure(.missingKey(key: "name")) + } + guard let name = Decoders.decode(clazz: String.self.self, source: nameSource).value else { + return .failure(.typeMismatch(expected: "Category", actual: "\(nameSource)")) + } + let _result = Category(name: name) switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { case let .success(value): _result.id = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - case let .success(value): _result.name = value - case let .failure(error): break - } return .success(_result) } else { return .failure(.typeMismatch(expected: "Category", actual: "\(source)")) @@ -578,6 +598,24 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } + // Decoder for [DogAllOf] + Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in + return Decoders.decode(clazz: [DogAllOf].self, source: source) + } + + // Decoder for DogAllOf + Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = DogAllOf() + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { + case let .success(value): _result.breed = value + case let .failure(error): break + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) + } + } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -618,7 +656,13 @@ class Decoders { // Decoder for EnumTest Decoders.addDecoder(clazz: EnumTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = EnumTest() + guard let enumStringRequiredSource = sourceDictionary["enum_string_required"] as AnyObject? else { + return .failure(.missingKey(key: "enum_string_required")) + } + guard let enumStringRequired = Decoders.decode(clazz: EnumTest.EnumStringRequired.self.self, source: enumStringRequiredSource).value else { + return .failure(.typeMismatch(expected: "EnumTest", actual: "\(enumStringRequiredSource)")) + } + let _result = EnumTest(enumStringRequired: enumStringRequired) switch Decoders.decodeOptional(clazz: EnumTest.EnumString.self, source: sourceDictionary["enum_string"] as AnyObject?) { case let .success(value): _result.enumString = value case let .failure(error): break @@ -640,6 +684,46 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } + // Decoder for [File] + Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in + return Decoders.decode(clazz: [File].self, source: source) + } + + // Decoder for File + Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = File() + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { + case let .success(value): _result.sourceURI = value + case let .failure(error): break + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "File", actual: "\(source)")) + } + } + // Decoder for [FileSchemaTestClass] + Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in + return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) + } + + // Decoder for FileSchemaTestClass + Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + let _result = FileSchemaTestClass() + switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { + case let .success(value): _result.file = value + case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { + case let .success(value): _result.files = value + case let .failure(error): break + } + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) + } + } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -771,6 +855,14 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { + case let .success(value): _result.directMap = value + case let .failure(error): break + } + switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { + case let .success(value): _result.indirectMap = value + case let .failure(error): break + } return .success(_result) } else { return .failure(.typeMismatch(expected: "MapTest", actual: "\(source)")) @@ -1070,6 +1162,94 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } + // Decoder for [TypeHolderDefault] + Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in + return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) + } + + // Decoder for TypeHolderDefault + Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + guard let stringItemSource = sourceDictionary["string_item"] as AnyObject? else { + return .failure(.missingKey(key: "string_item")) + } + guard let stringItem = Decoders.decode(clazz: String.self.self, source: stringItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(stringItemSource)")) + } + guard let numberItemSource = sourceDictionary["number_item"] as AnyObject? else { + return .failure(.missingKey(key: "number_item")) + } + guard let numberItem = Decoders.decode(clazz: Double.self.self, source: numberItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(numberItemSource)")) + } + guard let integerItemSource = sourceDictionary["integer_item"] as AnyObject? else { + return .failure(.missingKey(key: "integer_item")) + } + guard let integerItem = Decoders.decode(clazz: Int32.self.self, source: integerItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(integerItemSource)")) + } + guard let boolItemSource = sourceDictionary["bool_item"] as AnyObject? else { + return .failure(.missingKey(key: "bool_item")) + } + guard let boolItem = Decoders.decode(clazz: Bool.self.self, source: boolItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(boolItemSource)")) + } + guard let arrayItemSource = sourceDictionary["array_item"] as AnyObject? else { + return .failure(.missingKey(key: "array_item")) + } + guard let arrayItem = Decoders.decode(clazz: [Int32].self.self, source: arrayItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(arrayItemSource)")) + } + let _result = TypeHolderDefault(stringItem: stringItem, numberItem: numberItem, integerItem: integerItem, boolItem: boolItem, arrayItem: arrayItem) + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) + } + } + // Decoder for [TypeHolderExample] + Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in + return Decoders.decode(clazz: [TypeHolderExample].self, source: source) + } + + // Decoder for TypeHolderExample + Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in + if let sourceDictionary = source as? [AnyHashable: Any] { + guard let stringItemSource = sourceDictionary["string_item"] as AnyObject? else { + return .failure(.missingKey(key: "string_item")) + } + guard let stringItem = Decoders.decode(clazz: String.self.self, source: stringItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(stringItemSource)")) + } + guard let numberItemSource = sourceDictionary["number_item"] as AnyObject? else { + return .failure(.missingKey(key: "number_item")) + } + guard let numberItem = Decoders.decode(clazz: Double.self.self, source: numberItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(numberItemSource)")) + } + guard let integerItemSource = sourceDictionary["integer_item"] as AnyObject? else { + return .failure(.missingKey(key: "integer_item")) + } + guard let integerItem = Decoders.decode(clazz: Int32.self.self, source: integerItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(integerItemSource)")) + } + guard let boolItemSource = sourceDictionary["bool_item"] as AnyObject? else { + return .failure(.missingKey(key: "bool_item")) + } + guard let boolItem = Decoders.decode(clazz: Bool.self.self, source: boolItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(boolItemSource)")) + } + guard let arrayItemSource = sourceDictionary["array_item"] as AnyObject? else { + return .failure(.missingKey(key: "array_item")) + } + guard let arrayItem = Decoders.decode(clazz: [Int32].self.self, source: arrayItemSource).value else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(arrayItemSource)")) + } + let _result = TypeHolderExample(stringItem: stringItem, numberItem: numberItem, integerItem: integerItem, boolItem: boolItem, arrayItem: arrayItem) + return .success(_result) + } else { + return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) + } + } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index c36f0571b306..dc74e77f88cd 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,19 +10,19 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? - public init(mapProperty: [String:String]?=nil, mapOfMapProperty: [String:[String:String]]?=nil) { - self.mapProperty = mapProperty - self.mapOfMapProperty = mapOfMapProperty + public init(mapString: [String:String]?=nil, mapMapString: [String:[String:String]]?=nil) { + self.mapString = mapString + self.mapMapString = mapMapString } // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() + nillableDictionary["map_string"] = self.mapString?.encodeToJSON() + nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 61d01b5e094f..69cd8cd074e3 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -11,10 +11,10 @@ import Foundation open class Category: JSONEncodable { public var id: Int64? - public var name: String? + public var name: String - public init(id: Int64?=nil, name: String?=nil) { + public init(id: Int64?=nil, name: String) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 896b7d33b20a..57865687dd68 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,6 +15,11 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } + public enum EnumStringRequired: String { + case upper = "UPPER" + case lower = "lower" + case empty = "" + } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -24,13 +29,15 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? + public var enumStringRequired: EnumStringRequired public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init(enumString: EnumString?=nil, enumInteger: EnumInteger?=nil, enumNumber: EnumNumber?=nil, outerEnum: OuterEnum?=nil) { + public init(enumString: EnumString?=nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?=nil, enumNumber: EnumNumber?=nil, outerEnum: OuterEnum?=nil) { self.enumString = enumString + self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger self.enumNumber = enumNumber self.outerEnum = outerEnum @@ -39,6 +46,7 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue + nillableDictionary["enum_string_required"] = self.enumStringRequired.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index b1f04aad6ce7..b5f10f5061bc 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,16 +16,22 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? + public var indirectMap: [String:Bool]? - public init(mapMapOfString: [String:[String:String]]?=nil, mapOfEnumString: [String:String]?=nil) { + public init(mapMapOfString: [String:[String:String]]?=nil, mapOfEnumString: [String:String]?=nil, directMap: [String:Bool]?=nil, indirectMap: [String:Bool]?=nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString + self.directMap = directMap + self.indirectMap = indirectMap } // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario + nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() + nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/unwraprequired/git_push.sh b/samples/client/petstore/swift3/unwraprequired/git_push.sh index 20057f67ade4..ced3be2b0c7b 100644 --- a/samples/client/petstore/swift3/unwraprequired/git_push.sh +++ b/samples/client/petstore/swift3/unwraprequired/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift4/default/Package.swift b/samples/client/petstore/swift4/default/Package.swift index e5c5f0f33b82..a847bc5077d1 100644 --- a/samples/client/petstore/swift4/default/Package.swift +++ b/samples/client/petstore/swift4/default/Package.swift @@ -9,11 +9,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -22,6 +22,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire"], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index 832282d224f8..13586cdadd87 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 02e24286e3c8..1e6b7fc02c2c 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags @@ -14,7 +16,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 8f5d7550f0c8..d04aec357766 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,13 +7,15 @@ import Foundation + + open class FakeAPI { /** - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -42,7 +44,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -71,7 +73,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -100,7 +102,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -129,8 +131,8 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -163,8 +165,8 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -200,7 +202,7 @@ open class FakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -244,8 +246,8 @@ open class FakeAPI { - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - 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)) { - testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in + 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)) { + testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -280,7 +282,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -299,7 +301,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -387,8 +389,8 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -414,19 +416,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -451,8 +453,8 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -476,13 +478,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -502,8 +504,8 @@ open class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -518,7 +520,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -537,8 +539,8 @@ open class FakeAPI { - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -557,14 +559,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 060d434fbf24..822a371cef34 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -14,7 +16,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index fe75962a72cf..cc4397947d1d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -14,8 +16,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -52,8 +54,8 @@ open class PetAPI { - parameter apiKey: (header) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -78,8 +80,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -106,7 +108,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -125,8 +127,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -143,7 +145,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -162,8 +164,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -180,7 +182,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -202,8 +204,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -217,8 +219,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -256,8 +258,8 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -283,14 +285,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -306,7 +308,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -329,14 +331,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -352,7 +354,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in completion(response?.body, error) } @@ -375,14 +377,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index d5f627df52ac..b62f18f3f020 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -14,8 +16,8 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -37,8 +39,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -51,7 +53,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -66,14 +68,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -84,7 +86,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -103,8 +105,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -118,7 +120,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index ef4f971a91e2..0e2d140e037d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -14,8 +16,8 @@ open class UserAPI { - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -49,8 +51,8 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -83,8 +85,8 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -117,8 +119,8 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -140,8 +142,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -155,7 +157,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -173,8 +175,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -189,7 +191,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -206,11 +208,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -224,8 +226,8 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in + open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -242,8 +244,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -258,8 +260,8 @@ open class UserAPI { - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 1d54e695608b..f8521a9c036e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? + var filename : String? = nil for contentItem in items { @@ -294,7 +295,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -435,7 +436,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild return } - var responseObj: Response? + var responseObj: Response? = nil let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 27cf29c65600..57bab28b1998 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T: Encodable { + open class func encode(_ value: T) -> EncodeResult where T : Encodable { var returnedData: Data? - var returnedError: Error? + var returnedError: Error? = nil do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 74fcfcf2ad49..1f948ae12f78 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,3 +171,5 @@ extension KeyedDecodingContainerProtocol { } } + + diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index fb76bbed26f7..ca05906d4206 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? + var returnedParams: Parameters? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 827bdec87782..6ae673e1f8ca 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? + var params: Parameters? = nil if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 25161165865e..408563890359 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 83a06951ccd6..0ecd9e9d4e0b 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 3843287630b1..cdd102c3d0e3 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index f8b198e81f50..d8a83cb03753 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 67f7f7e5151f..45719d7100b9 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d576b50b1c9c..a9b2521b4ba0 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 5034ff0b8c68..93a138311b13 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 3c1dfcac577d..7280a621fec7 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 6db9b34d183b..4defea58d77e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 08d59953873e..b29b4547e709 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 3a10a7dfcaf6..0d8fd2848677 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 78917d75b44d..7569b92e8833 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 43c4891e1e23..d26d95857f64 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index abd2269e8e76..c1578e7a6d45 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index a6e1b1d2e5e4..985f4ab1c5b0 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable { case placed = "placed" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 49aec001c5db..aff2203aec73 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9f80fc95ecf0..bd1643d279ed 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index af60a550bb19..bb0c4d4318a7 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable { case available = "available" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index b34ddc68142d..72d6444ce88f 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e79fc45c0e91..3eb74d35d491 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index bf0006e1a266..ac559dda6f3f 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 602a2a6d185a..85498b617641 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/Package.swift b/samples/client/petstore/swift4/nonPublicApi/Package.swift index e5c5f0f33b82..a847bc5077d1 100644 --- a/samples/client/petstore/swift4/nonPublicApi/Package.swift +++ b/samples/client/petstore/swift4/nonPublicApi/Package.swift @@ -9,11 +9,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -22,6 +22,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire"], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 8641eb7ebf77..93b30800826e 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation internal struct APIHelper { - internal static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + internal static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ internal struct APIHelper { return destination } - internal static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + internal static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - internal static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + internal static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ internal struct APIHelper { } internal static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - internal static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + internal static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ internal struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift index 4e09f94504fc..04afd1c37640 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation internal class PetstoreClientAPI { internal static var basePath = "http://petstore.swagger.io:80/v2" internal static var credential: URLCredential? - internal static var customHeaders: [String: String] = [:] + internal static var customHeaders: [String:String] = [:] internal static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() internal static var apiResponseQueue: DispatchQueue = .main } internal class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - internal let parameters: [String: Any]? + var headers: [String:String] + internal let parameters: [String:Any]? internal let isBody: Bool internal let method: String internal let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - internal var onProgressReady: ((Progress) -> Void)? + internal var onProgressReady: ((Progress) -> ())? - required internal init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required internal init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ internal class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - internal func addHeaders(_ aHeaders: [String: String]) { + internal func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ internal class RequestBuilder { internal protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 9126bafa69ca..015f165c9f92 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class AnotherFakeAPI { /** To test special tags @@ -14,7 +16,7 @@ internal class AnotherFakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - internal class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + internal class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 7fcf9f8545df..7814f31d4327 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,13 +7,15 @@ import Foundation + + internal class FakeAPI { /** - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + internal class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -42,7 +44,7 @@ internal class FakeAPI { - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -71,7 +73,7 @@ internal class FakeAPI { - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + internal class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -100,7 +102,7 @@ internal class FakeAPI { - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + internal class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -129,8 +131,8 @@ internal class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - internal class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in + internal class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -163,8 +165,8 @@ internal class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - internal class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in + internal class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -200,7 +202,7 @@ internal class FakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - internal class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + internal class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -244,8 +246,8 @@ internal class FakeAPI { - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - 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)) { - testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in + 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)) { + testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -280,7 +282,7 @@ internal class FakeAPI { internal class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -299,7 +301,7 @@ internal class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -387,8 +389,8 @@ internal class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - parameter completion: completion handler to receive the data and the error objects */ - internal class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in + internal class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -414,19 +416,19 @@ internal class FakeAPI { internal class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -451,8 +453,8 @@ internal class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in + internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -476,13 +478,13 @@ internal class FakeAPI { internal class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -502,8 +504,8 @@ internal class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - internal class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in + internal class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -518,7 +520,7 @@ internal class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - internal class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + internal class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -537,8 +539,8 @@ internal class FakeAPI { - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - internal class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in + internal class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -557,14 +559,14 @@ internal class FakeAPI { internal class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index e4c221d8cb41..47ea5157ae2b 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + internal class FakeClassnameTags123API { /** To test class name in snake case @@ -14,7 +16,7 @@ internal class FakeClassnameTags123API { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - internal class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + internal class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 88b3b5b893c8..8745eca9cffa 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class PetAPI { /** Add a new pet to the store @@ -14,8 +16,8 @@ internal class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - internal class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in + internal class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -52,8 +54,8 @@ internal class PetAPI { - parameter petId: (path) Pet id to delete - parameter completion: completion handler to receive the data and the error objects */ - internal class func deletePet(apiKey: String? = nil, petId: Int64, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute { (_, error) -> Void in + internal class func deletePet(apiKey: String? = nil, petId: Int64, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -78,8 +80,8 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -106,7 +108,7 @@ internal class PetAPI { - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - internal class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + internal class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -125,8 +127,8 @@ internal class PetAPI { internal class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -143,7 +145,7 @@ internal class PetAPI { - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - internal class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + internal class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -162,8 +164,8 @@ internal class PetAPI { internal class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -180,7 +182,7 @@ internal class PetAPI { - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - internal class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + internal class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -202,8 +204,8 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -217,8 +219,8 @@ internal class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - internal class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in + internal class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -256,8 +258,8 @@ internal class PetAPI { - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in + internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -283,14 +285,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -306,7 +308,7 @@ internal class PetAPI { - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -329,14 +331,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -352,7 +354,7 @@ internal class PetAPI { - parameter requiredFile: (form) file to upload - parameter completion: completion handler to receive the data and the error objects */ - internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute { (response, error) -> Void in completion(response?.body, error) } @@ -375,14 +377,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index cfd546b9095f..cbf018279aca 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class StoreAPI { /** Delete purchase order by ID @@ -14,8 +16,8 @@ internal class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - internal class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in + internal class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -37,8 +39,8 @@ internal class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -51,7 +53,7 @@ internal class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ - internal class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + internal class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -66,14 +68,14 @@ internal class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - internal class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + internal class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -84,7 +86,7 @@ internal class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - internal class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + internal class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -103,8 +105,8 @@ internal class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -118,7 +120,7 @@ internal class StoreAPI { - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - internal class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + internal class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 76d77e2cf338..7d85f91c685c 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class UserAPI { /** Create user @@ -14,8 +16,8 @@ internal class UserAPI { - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in + internal class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -49,8 +51,8 @@ internal class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + internal class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -83,8 +85,8 @@ internal class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + internal class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -117,8 +119,8 @@ internal class UserAPI { - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - internal class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in + internal class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -140,8 +142,8 @@ internal class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -155,7 +157,7 @@ internal class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + internal class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -173,8 +175,8 @@ internal class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -189,7 +191,7 @@ internal class UserAPI { - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - internal class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + internal class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -206,11 +208,11 @@ internal class UserAPI { internal class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -224,8 +226,8 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ - internal class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in + internal class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -242,8 +244,8 @@ internal class UserAPI { internal class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -258,8 +260,8 @@ internal class UserAPI { - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - internal class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in + internal class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 691163584e0e..aef46f478f58 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() internal class AlamofireRequestBuilder: RequestBuilder { - required internal init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required internal init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ internal class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - internal func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + internal func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override internal func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ internal class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? + var filename : String? = nil for contentItem in items { @@ -294,7 +295,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -303,7 +304,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ internal enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -internal class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +internal class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -435,7 +436,7 @@ internal class AlamofireDecodableRequestBuilder: AlamofireRequestB return } - var responseObj: Response? + var responseObj: Response? = nil let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 86c1f884b2e9..c0cfcf2343ec 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ internal class CodableHelper { set { self.customJSONEncoder = newValue } } - internal class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? + internal class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ internal class CodableHelper { return (returnedDecodable, returnedError) } - internal class func encode(_ value: T) -> EncodeResult where T: Encodable { + internal class func encode(_ value: T) -> EncodeResult where T : Encodable { var returnedData: Data? - var returnedError: Error? + var returnedError: Error? = nil do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ internal class CodableHelper { return (returnedData, returnedError) } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift index bfcf939d4bb3..8cca45583256 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation internal class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. internal static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 66f407c1c5f9..e6ecffbab5de 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - internal mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + internal mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - internal mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + internal mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - internal mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + internal mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - internal mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + internal mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - internal func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + internal func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - internal func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + internal func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - internal func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + internal func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,3 +171,5 @@ extension KeyedDecodingContainerProtocol { } } + + diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index bd9f3a2ed0d5..cb5959f0fa43 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ internal struct JSONDataEncoding: ParameterEncoding { } internal static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? + var returnedParams: Parameters? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index fe09f37cd02f..22b34d0a00cc 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire internal class JSONEncodingHelper { - internal class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? + internal class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ internal class JSONEncodingHelper { } internal class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? + var params: Parameters? = nil if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ internal class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift index 5c253abc2c40..336c8848ba9d 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -internal enum ErrorResponse: Error { +internal enum ErrorResponse : Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ internal class Response { internal convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 203d2c1a931d..33150dbca3c5 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -internal struct AdditionalPropertiesClass: Codable { - internal var mapString: [String: String]? - internal var mapMapString: [String: [String: String]]? +internal struct AdditionalPropertiesClass: Codable { - internal init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + internal var mapString: [String:String]? + internal var mapMapString: [String:[String:String]]? + + internal init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index ada7f86de509..20d157f4ebcb 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Animal: Codable { + +internal struct Animal: Codable { + internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index 3ebe9e9a5dea..9c570350859f 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + internal typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index b60d8999b4b2..88b4b69c1668 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ApiResponse: Codable { + +internal struct ApiResponse: Codable { + internal var code: Int? internal var type: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index ef26025dcd8f..01a9efa00240 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ArrayOfArrayOfNumberOnly: Codable { + +internal struct ArrayOfArrayOfNumberOnly: Codable { + internal var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ internal struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 1147e9394c72..d7bbb8415104 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ArrayOfNumberOnly: Codable { + +internal struct ArrayOfNumberOnly: Codable { + internal var arrayNumber: [Double]? @@ -15,7 +17,7 @@ internal struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index ffbc3ebc7367..a90beac0b422 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ArrayTest: Codable { + +internal struct ArrayTest: Codable { + internal var arrayOfString: [String]? internal var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ internal struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 52cdbb01be79..7243c00a658a 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Capitalization: Codable { + +internal struct Capitalization: Codable { + internal var smallCamel: String? internal var capitalCamel: String? @@ -26,7 +28,7 @@ internal struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 8a603dee5f1f..28292469ddae 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Cat: Codable { + +internal struct Cat: Codable { + internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 45b7dbb26dcf..cdcb1aa14b57 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -internal struct CatAllOf: Codable { + +internal struct CatAllOf: Codable { + internal var declawed: Bool? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 849bf788dfb3..9b061937e091 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Category: Codable { + +internal struct Category: Codable { + internal var id: Int64? internal var name: String = "default-name" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 0f1bc19fe595..034cbadc8dd6 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -internal struct ClassModel: Codable { +internal struct ClassModel: Codable { + internal var _class: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index ddee836043fa..e33907ca3a3c 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Client: Codable { + +internal struct Client: Codable { + internal var client: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 6b5250de4a4a..3d45b8ac7a13 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Dog: Codable { + +internal struct Dog: Codable { + internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index ef3ff7f1d78b..6fb9a0505161 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -internal struct DogAllOf: Codable { + +internal struct DogAllOf: Codable { + internal var breed: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index b84e5e2e1e2f..77ba02482620 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -internal struct EnumArrays: Codable { + +internal struct EnumArrays: Codable { + internal enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ internal struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 2520f9bd8593..432332510cfc 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + internal enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index eba9a8056efd..ee3999df99eb 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -internal struct EnumTest: Codable { + +internal struct EnumTest: Codable { + internal enum EnumString: String, Codable { case upper = "UPPER" @@ -41,7 +43,7 @@ internal struct EnumTest: Codable { self.outerEnum = outerEnum } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 632402fb9e03..166138041ecf 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -internal struct File: Codable { +internal struct File: Codable { + /** Test capitalization */ internal var sourceURI: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index e478e6c4b7d1..2245e94bcc90 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -internal struct FileSchemaTestClass: Codable { + +internal struct FileSchemaTestClass: Codable { + internal var file: File? internal var files: [File]? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 23395c93b569..30b11efb2e19 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -internal struct FormatTest: Codable { + +internal struct FormatTest: Codable { + internal var integer: Int? internal var int32: Int? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 831963ba2ed2..d51b4421dfe6 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -internal struct HasOnlyReadOnly: Codable { + +internal struct HasOnlyReadOnly: Codable { + internal var bar: String? internal var foo: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift index ba9579996d19..4481dfc69378 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -internal struct List: Codable { + +internal struct List: Codable { + internal var _123list: String? @@ -15,7 +17,7 @@ internal struct List: Codable { self._123list = _123list } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index f59541f76751..0f5227354ff2 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -internal struct MapTest: Codable { + +internal struct MapTest: Codable { + internal enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - internal var mapMapOfString: [String: [String: String]]? - internal var mapOfEnumString: [String: String]? - internal var directMap: [String: Bool]? + internal var mapMapOfString: [String:[String:String]]? + internal var mapOfEnumString: [String:String]? + internal var directMap: [String:Bool]? internal var indirectMap: StringBooleanMap? - internal init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + internal init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c71bb9256b0a..c6fa4baaecd7 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + internal var uuid: UUID? internal var dateTime: Date? - internal var map: [String: Animal]? + internal var map: [String:Animal]? - internal init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + internal init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index bd288322e758..2d80f746854b 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -internal struct Model200Response: Codable { +internal struct Model200Response: Codable { + internal var name: Int? internal var _class: String? @@ -18,7 +19,7 @@ internal struct Model200Response: Codable { self._class = _class } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 85a5b7953954..cd3d69aa604f 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -internal struct Name: Codable { +internal struct Name: Codable { + internal var name: Int internal var snakeCase: Int? @@ -22,7 +23,7 @@ internal struct Name: Codable { self._123number = _123number } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 7dbe99f1426c..bcce308e6bf1 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -internal struct NumberOnly: Codable { + +internal struct NumberOnly: Codable { + internal var justNumber: Double? @@ -15,7 +17,7 @@ internal struct NumberOnly: Codable { self.justNumber = justNumber } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 7f575485bf75..c01293b9bb0d 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Order: Codable { + +internal struct Order: Codable { + internal enum Status: String, Codable { case placed = "placed" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 04fbad30ef76..8bf13de7fdef 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -internal struct OuterComposite: Codable { + +internal struct OuterComposite: Codable { + internal var myNumber: Double? internal var myString: String? @@ -19,7 +21,7 @@ internal struct OuterComposite: Codable { self.myBoolean = myBoolean } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index fd2d4b4cdda6..790fd71c13d5 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + internal enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 951f5929f922..caf33c098ae0 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Pet: Codable { + +internal struct Pet: Codable { + internal enum Status: String, Codable { case available = "available" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index d02c6cc5fd9f..8792cf4aa754 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ReadOnlyFirst: Codable { + +internal struct ReadOnlyFirst: Codable { + internal var bar: String? internal var baz: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 2e28c04ef55d..6730250b647d 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -internal struct Return: Codable { +internal struct Return: Codable { + internal var _return: Int? @@ -16,7 +17,7 @@ internal struct Return: Codable { self._return = _return } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index b35724b1ca7a..726a4a00e35e 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -internal struct SpecialModelName: Codable { + +internal struct SpecialModelName: Codable { + internal var specialPropertyName: Int64? @@ -15,7 +17,7 @@ internal struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index dc3d00e13014..d1afe6732a46 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -internal struct StringBooleanMap: Codable { - internal var additionalProperties: [String: Bool] = [:] +internal struct StringBooleanMap: Codable { + + + + internal var additionalProperties: [String:Bool] = [:] internal subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ internal struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 1e4de951fb2c..923acc9b1f69 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Tag: Codable { + +internal struct Tag: Codable { + internal var id: Int64? internal var name: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 0cff6b6a2f8b..2aac384dba64 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -internal struct TypeHolderDefault: Codable { + +internal struct TypeHolderDefault: Codable { + internal var stringItem: String = "what" internal var numberItem: Double @@ -23,7 +25,7 @@ internal struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 5d8f63dfe4ae..0a525d8a614b 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -internal struct TypeHolderExample: Codable { + +internal struct TypeHolderExample: Codable { + internal var stringItem: String internal var numberItem: Double @@ -23,7 +25,7 @@ internal struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift index ada8a7f82d96..c2865a579220 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -internal struct User: Codable { + +internal struct User: Codable { + internal var id: Int64? internal var username: String? diff --git a/samples/client/petstore/swift4/objcCompatible/Package.swift b/samples/client/petstore/swift4/objcCompatible/Package.swift index e5c5f0f33b82..a847bc5077d1 100644 --- a/samples/client/petstore/swift4/objcCompatible/Package.swift +++ b/samples/client/petstore/swift4/objcCompatible/Package.swift @@ -9,11 +9,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -22,6 +22,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire"], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift index 832282d224f8..13586cdadd87 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 89e7eb02109c..a25d4f9f2914 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,14 +7,16 @@ import Foundation -@objc open class AnotherFakeAPI: NSObject { + + +@objc open class AnotherFakeAPI : NSObject { /** To test special tags - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 19738e6b1e74..ce2b56509255 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,13 +7,15 @@ import Foundation -@objc open class FakeAPI: NSObject { + + +@objc open class FakeAPI : NSObject { /** - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -42,7 +44,7 @@ import Foundation - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -71,7 +73,7 @@ import Foundation - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -100,7 +102,7 @@ import Foundation - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -129,8 +131,8 @@ import Foundation - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -163,8 +165,8 @@ import Foundation - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -200,7 +202,7 @@ import Foundation - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -244,8 +246,8 @@ import Foundation - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - 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)) { - testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in + 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)) { + testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -280,7 +282,7 @@ import Foundation open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -299,7 +301,7 @@ import Foundation let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -387,8 +389,8 @@ import Foundation - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -414,19 +416,19 @@ import Foundation open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -451,8 +453,8 @@ import Foundation - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -476,13 +478,13 @@ import Foundation open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -502,8 +504,8 @@ import Foundation - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -518,7 +520,7 @@ import Foundation - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -537,8 +539,8 @@ import Foundation - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -557,14 +559,14 @@ import Foundation open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index ba8571a22f9d..ba98b694e055 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,14 +7,16 @@ import Foundation -@objc open class FakeClassnameTags123API: NSObject { + + +@objc open class FakeClassnameTags123API : NSObject { /** To test class name in snake case - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 25c4dfc14918..4d42b6003db6 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,15 +7,17 @@ import Foundation -@objc open class PetAPI: NSObject { + + +@objc open class PetAPI : NSObject { /** Add a new pet to the store - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -52,8 +54,8 @@ import Foundation - parameter apiKey: (header) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -78,8 +80,8 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -106,7 +108,7 @@ import Foundation - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -125,8 +127,8 @@ import Foundation open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -143,7 +145,7 @@ import Foundation - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -162,8 +164,8 @@ import Foundation open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -180,7 +182,7 @@ import Foundation - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -202,8 +204,8 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -217,8 +219,8 @@ import Foundation - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -256,8 +258,8 @@ import Foundation - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -283,14 +285,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -306,7 +308,7 @@ import Foundation - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -329,14 +331,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -352,7 +354,7 @@ import Foundation - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in completion(response?.body, error) } @@ -375,14 +377,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index c2d0578f0a47..cd1d037267c5 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,15 +7,17 @@ import Foundation -@objc open class StoreAPI: NSObject { + + +@objc open class StoreAPI : NSObject { /** Delete purchase order by ID - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -37,8 +39,8 @@ import Foundation let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -51,7 +53,7 @@ import Foundation - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -66,14 +68,14 @@ import Foundation - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -84,7 +86,7 @@ import Foundation - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -103,8 +105,8 @@ import Foundation let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -118,7 +120,7 @@ import Foundation - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index ad10a9334db6..422fea289c86 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,15 +7,17 @@ import Foundation -@objc open class UserAPI: NSObject { + + +@objc open class UserAPI : NSObject { /** Create user - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -49,8 +51,8 @@ import Foundation - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -83,8 +85,8 @@ import Foundation - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -117,8 +119,8 @@ import Foundation - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -140,8 +142,8 @@ import Foundation let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -155,7 +157,7 @@ import Foundation - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -173,8 +175,8 @@ import Foundation let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -189,7 +191,7 @@ import Foundation - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -206,11 +208,11 @@ import Foundation open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -224,8 +226,8 @@ import Foundation - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in + open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -242,8 +244,8 @@ import Foundation open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -258,8 +260,8 @@ import Foundation - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 1d54e695608b..f8521a9c036e 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? + var filename : String? = nil for contentItem in items { @@ -294,7 +295,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -435,7 +436,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild return } - var responseObj: Response? + var responseObj: Response? = nil let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 27cf29c65600..57bab28b1998 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T: Encodable { + open class func encode(_ value: T) -> EncodeResult where T : Encodable { var returnedData: Data? - var returnedError: Error? + var returnedError: Error? = nil do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 74fcfcf2ad49..1f948ae12f78 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,3 +171,5 @@ extension KeyedDecodingContainerProtocol { } } + + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index fb76bbed26f7..ca05906d4206 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? + var returnedParams: Parameters? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 827bdec87782..6ae673e1f8ca 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? + var params: Parameters? = nil if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index 25161165865e..408563890359 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 25a2d8b46c03..6b4ceee8d27f 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -@objc public class AdditionalPropertiesClass: NSObject, Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { +@objc public class AdditionalPropertiesClass: NSObject, Codable { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index b63ebe3aad4d..ca491b8e6ee4 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Animal: NSObject, Codable { + + +@objc public class Animal: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -17,7 +19,7 @@ import Foundation self.color = color } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _className = "className" case color } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index d0fcd4368854..d9a7fae21446 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ApiResponse: NSObject, Codable { + + +@objc public class ApiResponse: NSObject, Codable { public var code: Int? public var codeNum: NSNumber? { diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index fddd1e8eb2e2..97f72fd25477 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable { + + +@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable { public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ import Foundation self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 0a3450dd69f9..533b1884141a 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ArrayOfNumberOnly: NSObject, Codable { + + +@objc public class ArrayOfNumberOnly: NSObject, Codable { public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ import Foundation self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index dbc35d31065c..29777039b221 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ArrayTest: NSObject, Codable { + + +@objc public class ArrayTest: NSObject, Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ import Foundation self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 27102732b74e..7207f5c4f188 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Capitalization: NSObject, Codable { + + +@objc public class Capitalization: NSObject, Codable { public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ import Foundation self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index c78d15eecbc9..53283a41bf54 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Cat: NSObject, Codable { + + +@objc public class Cat: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -24,7 +26,7 @@ import Foundation self.declawed = declawed } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _className = "className" case color case declawed diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index ef8cec45aff1..8758762c40bf 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class CatAllOf: NSObject, Codable { + + +@objc public class CatAllOf: NSObject, Codable { public var declawed: Bool? public var declawedNum: NSNumber? { diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 94d01910abe8..680e496eebfd 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Category: NSObject, Codable { + + +@objc public class Category: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -22,7 +24,7 @@ import Foundation self.name = name } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case name } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 4197ffcaed6c..c221ccf2a0de 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -@objc public class ClassModel: NSObject, Codable { +@objc public class ClassModel: NSObject, Codable { public var _class: String? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 517dbbba2ec2..5aea86fbb06e 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Client: NSObject, Codable { + + +@objc public class Client: NSObject, Codable { public var client: String? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index e6a878a1ea05..ac99307cf475 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Dog: NSObject, Codable { + + +@objc public class Dog: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -19,7 +21,7 @@ import Foundation self.breed = breed } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _className = "className" case color case breed diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 73fd1822725c..efcd880f10b3 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class DogAllOf: NSObject, Codable { + + +@objc public class DogAllOf: NSObject, Codable { public var breed: String? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 4e35e79a6820..5448468bc989 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class EnumArrays: NSObject, Codable { + + +@objc public class EnumArrays: NSObject, Codable { public enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ import Foundation self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 3c1dfcac577d..7280a621fec7 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index a6906e8bbef9..fb0daceeb9c8 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class EnumTest: NSObject, Codable { + + +@objc public class EnumTest: NSObject, Codable { public enum EnumString: String, Codable { case upper = "UPPER" @@ -41,7 +43,7 @@ import Foundation self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 7a320c177d38..120d5bb78797 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -9,7 +9,7 @@ import Foundation /** Must be named `File` for test. */ -@objc public class File: NSObject, Codable { +@objc public class File: NSObject, Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index a6437b4fe901..e60109a85334 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class FileSchemaTestClass: NSObject, Codable { + + +@objc public class FileSchemaTestClass: NSObject, Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index df2c46d3757b..664481c02fc4 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class FormatTest: NSObject, Codable { + + +@objc public class FormatTest: NSObject, Codable { public var integer: Int? public var integerNum: NSNumber? { diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index b9f5b39117d7..974726b3e65d 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class HasOnlyReadOnly: NSObject, Codable { + + +@objc public class HasOnlyReadOnly: NSObject, Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 2ac4bfc90d84..85845898c713 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class List: NSObject, Codable { + + +@objc public class List: NSObject, Codable { public var _123list: String? @@ -15,7 +17,7 @@ import Foundation self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4fb067a5ffab..9d7f6a88bcc4 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -@objc public class MapTest: NSObject, Codable { + + +@objc public class MapTest: NSObject, Codable { public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index e10adad0a7e1..3ecb79bf9f43 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { + + +@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 2e9399332e6a..c46291158ddd 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model name starting with number */ -@objc public class Model200Response: NSObject, Codable { +@objc public class Model200Response: NSObject, Codable { public var name: Int? public var nameNum: NSNumber? { @@ -24,7 +24,7 @@ import Foundation self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index e30fd5a47152..61a3276f148b 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model name same as property name */ -@objc public class Name: NSObject, Codable { +@objc public class Name: NSObject, Codable { public var name: Int public var nameNum: NSNumber? { @@ -38,7 +38,7 @@ import Foundation self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 9a80fcacc6ca..b9b07101be22 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class NumberOnly: NSObject, Codable { + + +@objc public class NumberOnly: NSObject, Codable { public var justNumber: Double? @@ -15,7 +17,7 @@ import Foundation self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 37cfed6adb23..c4804715e8f6 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Order: NSObject, Codable { + + +@objc public class Order: NSObject, Codable { public enum Status: String, Codable { case placed = "placed" @@ -51,7 +53,7 @@ import Foundation self.complete = complete } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case petId case quantity diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 85ed62455d10..62e394ec3bde 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class OuterComposite: NSObject, Codable { + + +@objc public class OuterComposite: NSObject, Codable { public var myNumber: Double? public var myString: String? @@ -24,7 +26,7 @@ import Foundation self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9f80fc95ecf0..bd1643d279ed 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index f99f4d790ec6..285d9c54cf70 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Pet: NSObject, Codable { + + +@objc public class Pet: NSObject, Codable { public enum Status: String, Codable { case available = "available" @@ -36,7 +38,7 @@ import Foundation self.status = status } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case category case name diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index d1252433b2d8..2c806ac6d756 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ReadOnlyFirst: NSObject, Codable { + + +@objc public class ReadOnlyFirst: NSObject, Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 50c3614973df..afa39bb66b72 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing reserved words */ -@objc public class Return: NSObject, Codable { +@objc public class Return: NSObject, Codable { public var _return: Int? public var _returnNum: NSNumber? { @@ -22,7 +22,7 @@ import Foundation self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 0996025cce52..e55b92ed7a65 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class SpecialModelName: NSObject, Codable { + + +@objc public class SpecialModelName: NSObject, Codable { public var specialPropertyName: Int64? public var specialPropertyNameNum: NSNumber? { @@ -20,7 +22,7 @@ import Foundation self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index ffe9730a6fe4..3116d99bff0c 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -@objc public class StringBooleanMap: NSObject, Codable { - public var additionalProperties: [String: Bool] = [:] + +@objc public class StringBooleanMap: NSObject, Codable { + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ import Foundation additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a3994745e254..cd46f7db30d5 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Tag: NSObject, Codable { + + +@objc public class Tag: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -22,7 +24,7 @@ import Foundation self.name = name } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case name } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 382944d1b0d5..67e80d3f52c9 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class TypeHolderDefault: NSObject, Codable { + + +@objc public class TypeHolderDefault: NSObject, Codable { public var stringItem: String = "what" public var numberItem: Double @@ -33,7 +35,7 @@ import Foundation self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 0344e51e0e34..0f7968286201 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class TypeHolderExample: NSObject, Codable { + + +@objc public class TypeHolderExample: NSObject, Codable { public var stringItem: String public var numberItem: Double @@ -33,7 +35,7 @@ import Foundation self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 9b9b03a946f8..0c40ebf7142e 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class User: NSObject, Codable { + + +@objc public class User: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -40,7 +42,7 @@ import Foundation self.userStatus = userStatus } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case username case firstName diff --git a/samples/client/petstore/swift4/promisekitLibrary/Package.swift b/samples/client/petstore/swift4/promisekitLibrary/Package.swift index 7ba5c67b456c..fbf22f5f8236 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/Package.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/Package.swift @@ -9,12 +9,12 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), - .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.11.0") + .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.11.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -23,6 +23,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire", "PromiseKit"], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 832282d224f8..13586cdadd87 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 5b75a4da29fe..7399d2c1c562 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class AnotherFakeAPI { /** To test special tags diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 9ce9e5b16ae0..e63a581b40cc 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class FakeAPI { /** @@ -164,7 +166,7 @@ open class FakeAPI { */ open class func testBodyWithFileSchema( body: FileSchemaTestClass) -> Promise { let deferred = Promise.pending() - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -198,9 +200,9 @@ open class FakeAPI { - parameter body: (body) - returns: Promise */ - open class func testBodyWithQueryParams( query: String, body: User) -> Promise { + open class func testBodyWithQueryParams( query: String, body: User) -> Promise { let deferred = Promise.pending() - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -289,9 +291,9 @@ open class FakeAPI { - parameter callback: (form) None (optional) - returns: Promise */ - 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 { + 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 { let deferred = Promise.pending() - testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in + testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -327,7 +329,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -346,7 +348,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -434,9 +436,9 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - returns: Promise */ - open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise { + open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise { let deferred = Promise.pending() - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -463,19 +465,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -500,9 +502,9 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - returns: Promise */ - open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Promise { + open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Promise { let deferred = Promise.pending() - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -527,13 +529,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -553,9 +555,9 @@ open class FakeAPI { - parameter param: (body) request body - returns: Promise */ - open class func testInlineAdditionalProperties( param: [String: String]) -> Promise { + open class func testInlineAdditionalProperties( param: [String:String]) -> Promise { let deferred = Promise.pending() - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -571,7 +573,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -590,9 +592,9 @@ open class FakeAPI { - parameter param2: (form) field2 - returns: Promise */ - open class func testJsonFormData( param: String, param2: String) -> Promise { + open class func testJsonFormData( param: String, param2: String) -> Promise { let deferred = Promise.pending() - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -612,14 +614,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 574ec49021ba..f43f705eb6fb 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 8d31c177eb97..02a5e5417a6f 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class PetAPI { /** Add a new pet to the store @@ -17,7 +19,7 @@ open class PetAPI { */ open class func addPet( body: Pet) -> Promise { let deferred = Promise.pending() - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -55,9 +57,9 @@ open class PetAPI { - parameter apiKey: (header) (optional) - returns: Promise */ - open class func deletePet( petId: Int64, apiKey: String? = nil) -> Promise { + open class func deletePet( petId: Int64, apiKey: String? = nil) -> Promise { let deferred = Promise.pending() - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -83,8 +85,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -138,8 +140,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -183,8 +185,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -231,8 +233,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -248,7 +250,7 @@ open class PetAPI { */ open class func updatePet( body: Pet) -> Promise { let deferred = Promise.pending() - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -287,9 +289,9 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - returns: Promise */ - open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil) -> Promise { + open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil) -> Promise { let deferred = Promise.pending() - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -316,14 +318,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -339,7 +341,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - returns: Promise */ - open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Promise { + open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Promise { let deferred = Promise.pending() uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in if let error = error { @@ -370,14 +372,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -393,7 +395,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - returns: Promise */ - open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Promise { + open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Promise { let deferred = Promise.pending() uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in if let error = error { @@ -424,14 +426,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 685827cebe6a..eeb3548e88a0 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class StoreAPI { /** Delete purchase order by ID @@ -17,7 +19,7 @@ open class StoreAPI { */ open class func deleteOrder( orderId: String) -> Promise { let deferred = Promise.pending() - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -40,8 +42,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,8 +56,8 @@ open class StoreAPI { - returns: Promise<[String:Int]> */ - open class func getInventory() -> Promise<[String: Int]> { - let deferred = Promise<[String: Int]>.pending() + open class func getInventory() -> Promise<[String:Int]> { + let deferred = Promise<[String:Int]>.pending() getInventoryWithRequestBuilder().execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) @@ -77,14 +79,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -122,8 +124,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 83f4674553cb..ab269c056795 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class UserAPI { /** Create user @@ -17,7 +19,7 @@ open class UserAPI { */ open class func createUser( body: User) -> Promise { let deferred = Promise.pending() - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -54,7 +56,7 @@ open class UserAPI { */ open class func createUsersWithArrayInput( body: [User]) -> Promise { let deferred = Promise.pending() - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -90,7 +92,7 @@ open class UserAPI { */ open class func createUsersWithListInput( body: [User]) -> Promise { let deferred = Promise.pending() - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -126,7 +128,7 @@ open class UserAPI { */ open class func deleteUser( username: String) -> Promise { let deferred = Promise.pending() - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -149,8 +151,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -190,8 +192,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -206,7 +208,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - returns: Promise */ - open class func loginUser( username: String, password: String) -> Promise { + open class func loginUser( username: String, password: String) -> Promise { let deferred = Promise.pending() loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in if let error = error { @@ -231,11 +233,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -251,7 +253,7 @@ open class UserAPI { */ open class func logoutUser() -> Promise { let deferred = Promise.pending() - logoutUserWithRequestBuilder().execute { (_, error) -> Void in + logoutUserWithRequestBuilder().execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -269,8 +271,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -285,9 +287,9 @@ open class UserAPI { - parameter body: (body) Updated user object - returns: Promise */ - open class func updateUser( username: String, body: User) -> Promise { + open class func updateUser( username: String, body: User) -> Promise { let deferred = Promise.pending() - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 1d54e695608b..f8521a9c036e 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? + var filename : String? = nil for contentItem in items { @@ -294,7 +295,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -435,7 +436,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild return } - var responseObj: Response? + var responseObj: Response? = nil let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 27cf29c65600..57bab28b1998 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T: Encodable { + open class func encode(_ value: T) -> EncodeResult where T : Encodable { var returnedData: Data? - var returnedError: Error? + var returnedError: Error? = nil do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 0ee7b7f0f6d8..8278ae0f3b20 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -109,24 +109,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -136,7 +136,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -148,8 +148,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -158,8 +158,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -174,7 +174,7 @@ extension KeyedDecodingContainerProtocol { } extension RequestBuilder { - public func execute() -> Promise> { + public func execute() -> Promise> { let deferred = Promise>.pending() self.execute { (response: Response?, error: Error?) in if let response = response { diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index fb76bbed26f7..ca05906d4206 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? + var returnedParams: Parameters? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 827bdec87782..6ae673e1f8ca 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? + var params: Parameters? = nil if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 25161165865e..408563890359 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 83a06951ccd6..0ecd9e9d4e0b 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 3843287630b1..cdd102c3d0e3 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index f8b198e81f50..d8a83cb03753 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 67f7f7e5151f..45719d7100b9 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d576b50b1c9c..a9b2521b4ba0 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 5034ff0b8c68..93a138311b13 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 3c1dfcac577d..7280a621fec7 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 6db9b34d183b..4defea58d77e 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 08d59953873e..b29b4547e709 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 3a10a7dfcaf6..0d8fd2848677 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 78917d75b44d..7569b92e8833 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 43c4891e1e23..d26d95857f64 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index abd2269e8e76..c1578e7a6d45 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index a6e1b1d2e5e4..985f4ab1c5b0 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable { case placed = "placed" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 49aec001c5db..aff2203aec73 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9f80fc95ecf0..bd1643d279ed 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index af60a550bb19..bb0c4d4318a7 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable { case available = "available" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index b34ddc68142d..72d6444ce88f 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e79fc45c0e91..3eb74d35d491 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index bf0006e1a266..ac559dda6f3f 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 602a2a6d185a..85498b617641 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift4/resultLibrary/Package.swift b/samples/client/petstore/swift4/resultLibrary/Package.swift index e5c5f0f33b82..a847bc5077d1 100644 --- a/samples/client/petstore/swift4/resultLibrary/Package.swift +++ b/samples/client/petstore/swift4/resultLibrary/Package.swift @@ -9,11 +9,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -22,6 +22,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire"], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 832282d224f8..13586cdadd87 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index fb4bb8cfdb43..0cde67c78990 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags @@ -14,7 +16,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 341e23d3685b..3bd57a0b50d1 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,13 +7,15 @@ import Foundation + + open class FakeAPI { /** - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -58,7 +60,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -103,7 +105,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -148,7 +150,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -193,8 +195,8 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -208,7 +210,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ result: Result) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -241,8 +243,8 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -257,7 +259,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ result: Result) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -293,7 +295,7 @@ open class FakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -354,8 +356,8 @@ open class FakeAPI { - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - 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)) { - testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in + 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)) { + testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -383,7 +385,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ 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 ((_ result: Result) -> Void)) { - testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in + testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -418,7 +420,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -437,7 +439,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -525,8 +527,8 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -548,7 +550,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ result: Result) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -574,19 +576,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -611,8 +613,8 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -632,7 +634,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ result: Result) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -656,13 +658,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -682,8 +684,8 @@ open class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -697,8 +699,8 @@ open class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the result */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ result: Result) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ result: Result) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -713,7 +715,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -732,8 +734,8 @@ open class FakeAPI { - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -749,7 +751,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ result: Result) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -768,14 +770,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 09c9696dec65..3ee95e0d558e 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -14,7 +16,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 3c0ac53738ab..f6453d755eb4 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -14,8 +16,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -30,7 +32,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ open class func addPet(body: Pet, completion: @escaping ((_ result: Result) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -67,8 +69,8 @@ open class PetAPI { - parameter apiKey: (header) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -84,7 +86,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ result: Result) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -109,8 +111,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -137,7 +139,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -173,8 +175,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -191,7 +193,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -227,8 +229,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -245,7 +247,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -284,8 +286,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -299,8 +301,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -315,7 +317,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ open class func updatePet(body: Pet, completion: @escaping ((_ result: Result) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -353,8 +355,8 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -371,7 +373,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ result: Result) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -397,14 +399,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -420,7 +422,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -462,14 +464,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -485,7 +487,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in completion(response?.body, error) } @@ -527,14 +529,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 62ae519105c5..3540be19c3e2 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -14,8 +16,8 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -30,7 +32,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the result */ open class func deleteOrder(orderId: String, completion: @escaping ((_ result: Result) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -52,8 +54,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -66,7 +68,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -76,7 +78,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the result */ - open class func getInventory(completion: @escaping ((_ result: Result<[String: Int], Error>) -> Void)) { + open class func getInventory(completion: @escaping ((_ result: Result<[String:Int], Error>) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in if let error = error { completion(.failure(error)) @@ -97,14 +99,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -115,7 +117,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -151,8 +153,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -166,7 +168,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index c65cdfa1bce3..6ee23f9b678c 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -14,8 +16,8 @@ open class UserAPI { - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -30,7 +32,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ open class func createUser(body: User, completion: @escaping ((_ result: Result) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -64,8 +66,8 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -80,7 +82,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ result: Result) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -113,8 +115,8 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -129,7 +131,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ open class func createUsersWithListInput(body: [User], completion: @escaping ((_ result: Result) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -162,8 +164,8 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -178,7 +180,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ open class func deleteUser(username: String, completion: @escaping ((_ result: Result) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -200,8 +202,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -215,7 +217,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -250,8 +252,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -266,7 +268,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -301,11 +303,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -319,8 +321,8 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in + open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -334,7 +336,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ open class func logoutUser(completion: @escaping ((_ result: Result) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in + logoutUserWithRequestBuilder().execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -351,8 +353,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -367,8 +369,8 @@ open class UserAPI { - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -384,7 +386,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ open class func updateUser(username: String, body: User, completion: @escaping ((_ result: Result) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in if let error = error { completion(.failure(error)) } else { diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 1d54e695608b..f8521a9c036e 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? + var filename : String? = nil for contentItem in items { @@ -294,7 +295,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -435,7 +436,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild return } - var responseObj: Response? + var responseObj: Response? = nil let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 27cf29c65600..57bab28b1998 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T: Encodable { + open class func encode(_ value: T) -> EncodeResult where T : Encodable { var returnedData: Data? - var returnedError: Error? + var returnedError: Error? = nil do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 74fcfcf2ad49..1f948ae12f78 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,3 +171,5 @@ extension KeyedDecodingContainerProtocol { } } + + diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index fb76bbed26f7..ca05906d4206 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? + var returnedParams: Parameters? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 827bdec87782..6ae673e1f8ca 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? + var params: Parameters? = nil if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 25161165865e..408563890359 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 83a06951ccd6..0ecd9e9d4e0b 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 3843287630b1..cdd102c3d0e3 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index f8b198e81f50..d8a83cb03753 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 67f7f7e5151f..45719d7100b9 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d576b50b1c9c..a9b2521b4ba0 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 5034ff0b8c68..93a138311b13 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 3c1dfcac577d..7280a621fec7 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 6db9b34d183b..4defea58d77e 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 08d59953873e..b29b4547e709 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 3a10a7dfcaf6..0d8fd2848677 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 78917d75b44d..7569b92e8833 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 43c4891e1e23..d26d95857f64 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index abd2269e8e76..c1578e7a6d45 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index a6e1b1d2e5e4..985f4ab1c5b0 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable { case placed = "placed" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 49aec001c5db..aff2203aec73 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9f80fc95ecf0..bd1643d279ed 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index af60a550bb19..bb0c4d4318a7 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable { case available = "available" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index b34ddc68142d..72d6444ce88f 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e79fc45c0e91..3eb74d35d491 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index bf0006e1a266..ac559dda6f3f 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 602a2a6d185a..85498b617641 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/Package.swift b/samples/client/petstore/swift4/rxswiftLibrary/Package.swift index 6c19a2b64cc6..ad243b475b41 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/Package.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/Package.swift @@ -9,12 +9,12 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), - .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "4.5.0") + .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "4.5.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -23,6 +23,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire", "RxSwift"], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 832282d224f8..13586cdadd87 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 819fc85beda2..172d3e1d6c10 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class AnotherFakeAPI { /** To test special tags diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index a20128c73813..3c3862c01cea 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class FakeAPI { /** @@ -172,7 +174,7 @@ open class FakeAPI { */ open class func testBodyWithFileSchema(body: FileSchemaTestClass) -> Observable { return Observable.create { observer -> Disposable in - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -210,7 +212,7 @@ open class FakeAPI { */ open class func testBodyWithQueryParams(query: String, body: User) -> Observable { return Observable.create { observer -> Disposable in - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -305,7 +307,7 @@ open class FakeAPI { */ 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 { return Observable.create { observer -> Disposable in - testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in + testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -343,7 +345,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -362,7 +364,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -452,7 +454,7 @@ open class FakeAPI { */ open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Observable { return Observable.create { observer -> Disposable in - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -481,19 +483,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -520,7 +522,7 @@ open class FakeAPI { */ open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Observable { return Observable.create { observer -> Disposable in - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -547,13 +549,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -573,9 +575,9 @@ open class FakeAPI { - parameter param: (body) request body - returns: Observable */ - open class func testInlineAdditionalProperties(param: [String: String]) -> Observable { + open class func testInlineAdditionalProperties(param: [String:String]) -> Observable { return Observable.create { observer -> Disposable in - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -593,7 +595,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -614,7 +616,7 @@ open class FakeAPI { */ open class func testJsonFormData(param: String, param2: String) -> Observable { return Observable.create { observer -> Disposable in - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -636,14 +638,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index c34ace880ce8..0129283fe4d2 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 6b4797fc19a1..556ebcef5e8f 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class PetAPI { /** Add a new pet to the store @@ -17,7 +19,7 @@ open class PetAPI { */ open class func addPet(body: Pet) -> Observable { return Observable.create { observer -> Disposable in - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -59,7 +61,7 @@ open class PetAPI { */ open class func deletePet(petId: Int64, apiKey: String? = nil) -> Observable { return Observable.create { observer -> Disposable in - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -87,8 +89,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -144,8 +146,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -191,8 +193,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -241,8 +243,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -258,7 +260,7 @@ open class PetAPI { */ open class func updatePet(body: Pet) -> Observable { return Observable.create { observer -> Disposable in - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -301,7 +303,7 @@ open class PetAPI { */ open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil) -> Observable { return Observable.create { observer -> Disposable in - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -330,14 +332,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -386,14 +388,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -442,14 +444,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index c03311277b9a..a8c2b20948ef 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class StoreAPI { /** Delete purchase order by ID @@ -17,7 +19,7 @@ open class StoreAPI { */ open class func deleteOrder(orderId: String) -> Observable { return Observable.create { observer -> Disposable in - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -42,8 +44,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -56,7 +58,7 @@ open class StoreAPI { - returns: Observable<[String:Int]> */ - open class func getInventory() -> Observable<[String: Int]> { + open class func getInventory() -> Observable<[String:Int]> { return Observable.create { observer -> Disposable in getInventoryWithRequestBuilder().execute { (response, error) -> Void in if let error = error { @@ -81,14 +83,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -128,8 +130,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index ec28b4121d09..2a877f7c7f06 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class UserAPI { /** Create user @@ -17,7 +19,7 @@ open class UserAPI { */ open class func createUser(body: User) -> Observable { return Observable.create { observer -> Disposable in - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -56,7 +58,7 @@ open class UserAPI { */ open class func createUsersWithArrayInput(body: [User]) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -94,7 +96,7 @@ open class UserAPI { */ open class func createUsersWithListInput(body: [User]) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -132,7 +134,7 @@ open class UserAPI { */ open class func deleteUser(username: String) -> Observable { return Observable.create { observer -> Disposable in - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -157,8 +159,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -200,8 +202,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -243,11 +245,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -263,7 +265,7 @@ open class UserAPI { */ open class func logoutUser() -> Observable { return Observable.create { observer -> Disposable in - logoutUserWithRequestBuilder().execute { (_, error) -> Void in + logoutUserWithRequestBuilder().execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { @@ -283,8 +285,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -301,7 +303,7 @@ open class UserAPI { */ open class func updateUser(username: String, body: User) -> Observable { return Observable.create { observer -> Disposable in - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in if let error = error { observer.onError(error) } else { diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 1d54e695608b..f8521a9c036e 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? + var filename : String? = nil for contentItem in items { @@ -294,7 +295,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -435,7 +436,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild return } - var responseObj: Response? + var responseObj: Response? = nil let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 27cf29c65600..57bab28b1998 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T: Encodable { + open class func encode(_ value: T) -> EncodeResult where T : Encodable { var returnedData: Data? - var returnedError: Error? + var returnedError: Error? = nil do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 74fcfcf2ad49..1f948ae12f78 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,3 +171,5 @@ extension KeyedDecodingContainerProtocol { } } + + diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index fb76bbed26f7..ca05906d4206 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? + var returnedParams: Parameters? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 827bdec87782..6ae673e1f8ca 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? + var params: Parameters? = nil if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 25161165865e..408563890359 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 83a06951ccd6..0ecd9e9d4e0b 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 3843287630b1..cdd102c3d0e3 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index f8b198e81f50..d8a83cb03753 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 67f7f7e5151f..45719d7100b9 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d576b50b1c9c..a9b2521b4ba0 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 5034ff0b8c68..93a138311b13 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 3c1dfcac577d..7280a621fec7 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 6db9b34d183b..4defea58d77e 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 08d59953873e..b29b4547e709 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 3a10a7dfcaf6..0d8fd2848677 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 78917d75b44d..7569b92e8833 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 43c4891e1e23..d26d95857f64 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index abd2269e8e76..c1578e7a6d45 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index a6e1b1d2e5e4..985f4ab1c5b0 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable { case placed = "placed" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 49aec001c5db..aff2203aec73 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9f80fc95ecf0..bd1643d279ed 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index af60a550bb19..bb0c4d4318a7 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable { case available = "available" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index b34ddc68142d..72d6444ce88f 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e79fc45c0e91..3eb74d35d491 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index bf0006e1a266..ac559dda6f3f 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 602a2a6d185a..85498b617641 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/Package.swift b/samples/client/petstore/swift4/unwrapRequired/Package.swift index e5c5f0f33b82..a847bc5077d1 100644 --- a/samples/client/petstore/swift4/unwrapRequired/Package.swift +++ b/samples/client/petstore/swift4/unwrapRequired/Package.swift @@ -9,11 +9,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -22,6 +22,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire"], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift index 832282d224f8..13586cdadd87 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 02e24286e3c8..1e6b7fc02c2c 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags @@ -14,7 +16,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 8f5d7550f0c8..d04aec357766 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,13 +7,15 @@ import Foundation + + open class FakeAPI { /** - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -42,7 +44,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -71,7 +73,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -100,7 +102,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -129,8 +131,8 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -163,8 +165,8 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -200,7 +202,7 @@ open class FakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -244,8 +246,8 @@ open class FakeAPI { - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - 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)) { - testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in + 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)) { + testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -280,7 +282,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -299,7 +301,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -387,8 +389,8 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -414,19 +416,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -451,8 +453,8 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -476,13 +478,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -502,8 +504,8 @@ open class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in + open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -518,7 +520,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -537,8 +539,8 @@ open class FakeAPI { - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -557,14 +559,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 060d434fbf24..822a371cef34 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -14,7 +16,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index fe75962a72cf..cc4397947d1d 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -14,8 +16,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -52,8 +54,8 @@ open class PetAPI { - parameter apiKey: (header) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -78,8 +80,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -106,7 +108,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -125,8 +127,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -143,7 +145,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -162,8 +164,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -180,7 +182,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -202,8 +204,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -217,8 +219,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -256,8 +258,8 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -283,14 +285,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -306,7 +308,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -329,14 +331,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -352,7 +354,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in completion(response?.body, error) } @@ -375,14 +377,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index d5f627df52ac..b62f18f3f020 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -14,8 +16,8 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -37,8 +39,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -51,7 +53,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -66,14 +68,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -84,7 +86,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -103,8 +105,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -118,7 +120,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index ef4f971a91e2..0e2d140e037d 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -14,8 +16,8 @@ open class UserAPI { - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -49,8 +51,8 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -83,8 +85,8 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -117,8 +119,8 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -140,8 +142,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -155,7 +157,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -173,8 +175,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -189,7 +191,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -206,11 +208,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -224,8 +226,8 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in + open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (response, error) -> Void in if error == nil { completion((), error) } else { @@ -242,8 +244,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -258,8 +260,8 @@ open class UserAPI { - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in if error == nil { completion((), error) } else { diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 1d54e695608b..f8521a9c036e 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? + var filename : String? = nil for contentItem in items { @@ -294,7 +295,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -435,7 +436,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild return } - var responseObj: Response? + var responseObj: Response? = nil let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 27cf29c65600..57bab28b1998 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T: Encodable { + open class func encode(_ value: T) -> EncodeResult where T : Encodable { var returnedData: Data? - var returnedError: Error? + var returnedError: Error? = nil do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 74fcfcf2ad49..1f948ae12f78 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,3 +171,5 @@ extension KeyedDecodingContainerProtocol { } } + + diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index fb76bbed26f7..ca05906d4206 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? + var returnedParams: Parameters? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 827bdec87782..6ae673e1f8ca 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? + var params: Parameters? = nil if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift index 25161165865e..408563890359 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 83a06951ccd6..0ecd9e9d4e0b 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 88eceebd2a2a..ebfccc6ca8e2 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String? public var color: String? = "red" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 3843287630b1..cdd102c3d0e3 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index f8b198e81f50..d8a83cb03753 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 67f7f7e5151f..45719d7100b9 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d576b50b1c9c..a9b2521b4ba0 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index d6133a3dd5ca..7679dfd2d3ac 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String? public var color: String? = "red" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 48b43fc318df..1366c0d51315 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 35c8cea0dd04..ec7cd824eafa 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String? public var color: String? = "red" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 5034ff0b8c68..93a138311b13 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 3c1dfcac577d..7280a621fec7 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index b1eb8e98f89a..aa05b5552b3e 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 4eed10b95a11..dc82420e0d9c 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 08d59953873e..b29b4547e709 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 3a10a7dfcaf6..0d8fd2848677 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 78917d75b44d..7569b92e8833 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 785c43bda4c6..818bcc3a2fbf 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int? public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index abd2269e8e76..c1578e7a6d45 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index a6e1b1d2e5e4..985f4ab1c5b0 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable { case placed = "placed" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 49aec001c5db..aff2203aec73 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9f80fc95ecf0..bd1643d279ed 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 99eaa1329e48..715658cd5286 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable { case available = "available" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index b34ddc68142d..72d6444ce88f 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e79fc45c0e91..3eb74d35d491 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 07b590ab1079..cd44dea4a127 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String? = "what" public var numberItem: Double? @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 29d005161783..706d484fa293 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String? public var numberItem: Double? @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/Package.swift b/samples/client/petstore/swift5/alamofireLibrary/Package.swift index 9371b3d57bd4..6e820c6971b0 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/Package.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/Package.swift @@ -14,19 +14,19 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.1") + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.1"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "PetstoreClient", - dependencies: ["Alamofire" ], + dependencies: ["Alamofire", ], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index df7fa3936700..b229fb3e81b8 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 5bbf323f820c..bb3ae7178254 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): 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 134d6aea416a..d1d81faa335c 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 @@ -7,6 +7,8 @@ import Foundation + + open class FakeAPI { /** @@ -14,7 +16,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +51,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +86,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +121,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +156,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +192,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +231,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +281,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(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).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -316,7 +318,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -424,7 +426,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -452,19 +454,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -490,7 +492,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -516,13 +518,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -580,7 +582,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -601,14 +603,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 48cfe7187b9a..d21c4a49d43d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0552d4a6c16e..496da91171ac 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -154,7 +156,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -178,8 +180,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -197,7 +199,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -224,8 +226,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -240,7 +242,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -281,7 +283,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -309,14 +311,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -333,7 +335,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -361,14 +363,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -385,7 +387,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -413,14 +415,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index a8a83eda39a4..3848eda85ad6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 505ed1b0c5c9..546166841d9e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -15,7 +17,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +54,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +90,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +126,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -148,8 +150,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -164,7 +166,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -187,8 +189,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -204,7 +206,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,11 +228,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -245,7 +247,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -264,8 +266,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -281,7 +283,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: 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 368b4edffb93..e7320f28ec57 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -21,7 +21,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -59,17 +59,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -82,7 +82,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -101,7 +102,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } self.processRequest(request: upload, managerId, apiResponseQueue, completion) case .failure(let encodingError): - apiResponseQueue.async { + apiResponseQueue.async{ completion(.failure(ErrorResponse.error(415, nil, encodingError))) } } @@ -131,14 +132,14 @@ open class AlamofireRequestBuilder: RequestBuilder { case is String.Type: validatedRequest.responseString(queue: apiResponseQueue, completionHandler: { (stringResponse) in cleanupRequest() - + switch stringResponse.result { case let .success(value): completion(.success(Response(response: stringResponse.response!, body: value as? T))) case let .failure(error): completion(.failure(ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, error))) } - + }) case is URL.Type: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (dataResponse) in @@ -187,26 +188,26 @@ open class AlamofireRequestBuilder: RequestBuilder { case is Void.Type: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (voidResponse) in cleanupRequest() - + switch voidResponse.result { case .success: completion(.success(Response(response: voidResponse.response!, body: nil))) case let .failure(error): completion(.failure(ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, error))) } - + }) default: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (dataResponse) in cleanupRequest() - + switch dataResponse.result { case .success: completion(.success(Response(response: dataResponse.response!, body: dataResponse.data as? T))) case let .failure(error): completion(.failure(ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, error))) } - + }) } } @@ -219,7 +220,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -227,7 +228,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? + var filename : String? = nil for contentItem in items { @@ -238,7 +239,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -247,7 +248,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -261,7 +262,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -272,7 +273,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ apiResponseQueue: DispatchQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let credential = self.credential { @@ -289,7 +290,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild case is String.Type: validatedRequest.responseString(queue: apiResponseQueue, completionHandler: { (stringResponse) in cleanupRequest() - + switch stringResponse.result { case let .success(value): completion(.success(Response(response: stringResponse.response!, body: value as? T))) @@ -301,7 +302,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild case is Void.Type: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (voidResponse) in cleanupRequest() - + switch voidResponse.result { case .success: completion(.success(Response(response: voidResponse.response!, body: nil))) @@ -313,7 +314,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild case is Data.Type: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (dataResponse) in cleanupRequest() - + switch dataResponse.result { case .success: completion(.success(Response(response: dataResponse.response!, body: dataResponse.data as? T))) @@ -342,14 +343,14 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild } let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } - + }) } } @@ -357,9 +358,9 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild } extension JSONDataEncoding: ParameterEncoding { - + // MARK: Encoding - + /// Creates a URL request by encoding parameters and applying them onto an existing request. /// /// - parameter urlRequest: The request to have parameters applied. @@ -371,7 +372,7 @@ extension JSONDataEncoding: ParameterEncoding { /// - returns: The encoded request. public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { let urlRequest = try urlRequest.asURLRequest() - + return self.encode(urlRequest, with: parameters) } } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee12..4dc1d70aeb52 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 4dd8815847c6..9bf69037bf03 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/combineLibrary/Package.swift b/samples/client/petstore/swift5/combineLibrary/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/combineLibrary/Package.swift +++ b/samples/client/petstore/swift5/combineLibrary/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index e4cbda9c725d..6ee6f8f43c60 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 2df909dec9ad..cf5a4a61c291 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import Combine + + open class AnotherFakeAPI { /** To test special tags diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 47510b7781a5..ccfdc072331f 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 @@ -8,6 +8,8 @@ import Foundation import Combine + + open class FakeAPI { /** @@ -341,7 +343,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -360,7 +362,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -480,19 +482,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -547,13 +549,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -575,7 +577,7 @@ open class FakeAPI { - returns: AnyPublisher */ @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promisse in testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { @@ -594,7 +596,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -638,14 +640,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 6f0401af8885..7d04bd796bb7 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,6 +8,8 @@ import Foundation import Combine + + open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index a1dbbb6af860..564450e23db9 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,6 +8,8 @@ import Foundation import Combine + + open class PetAPI { /** Add a new pet to the store @@ -89,8 +91,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -145,8 +147,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -191,8 +193,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -240,8 +242,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -331,14 +333,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -386,14 +388,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -441,14 +443,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index b36a3a30c3a5..1a4392975b6b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Foundation import Combine + + open class StoreAPI { /** Delete purchase order by ID @@ -43,8 +45,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -59,8 +61,8 @@ open class StoreAPI { - returns: AnyPublisher<[String:Int], Error> */ @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[String: Int], Error> { - return Future<[String: Int], Error>.init { promisse in + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[String:Int], Error> { + return Future<[String:Int], Error>.init { promisse in getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -81,14 +83,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -127,8 +129,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 3d5694cc935c..59fec6d34fe6 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,6 +8,8 @@ import Foundation import Combine + + open class UserAPI { /** Create user @@ -161,8 +163,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -203,8 +205,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -245,11 +247,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -286,8 +288,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee12..4dc1d70aeb52 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 4dd8815847c6..9bf69037bf03 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? 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 ad5f58eea436..fb57e03ff8dd 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ private class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/default/Package.swift b/samples/client/petstore/swift5/default/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/default/Package.swift +++ b/samples/client/petstore/swift5/default/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index e4cbda9c725d..6ee6f8f43c60 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 5bbf323f820c..bb3ae7178254 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): 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 134d6aea416a..d1d81faa335c 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 @@ -7,6 +7,8 @@ import Foundation + + open class FakeAPI { /** @@ -14,7 +16,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +51,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +86,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +121,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +156,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +192,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +231,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +281,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(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).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -316,7 +318,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -424,7 +426,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -452,19 +454,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -490,7 +492,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -516,13 +518,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -580,7 +582,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -601,14 +603,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 48cfe7187b9a..d21c4a49d43d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0552d4a6c16e..496da91171ac 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -154,7 +156,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -178,8 +180,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -197,7 +199,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -224,8 +226,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -240,7 +242,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -281,7 +283,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -309,14 +311,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -333,7 +335,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -361,14 +363,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -385,7 +387,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -413,14 +415,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index a8a83eda39a4..3848eda85ad6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 505ed1b0c5c9..546166841d9e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -15,7 +17,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +54,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +90,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +126,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -148,8 +150,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -164,7 +166,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -187,8 +189,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -204,7 +206,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,11 +228,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -245,7 +247,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -264,8 +266,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -281,7 +283,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee12..4dc1d70aeb52 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 4dd8815847c6..9bf69037bf03 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? 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 ad5f58eea436..fb57e03ff8dd 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ private class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/nonPublicApi/Package.swift b/samples/client/petstore/swift5/nonPublicApi/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/nonPublicApi/Package.swift +++ b/samples/client/petstore/swift5/nonPublicApi/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 8641eb7ebf77..93b30800826e 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation internal struct APIHelper { - internal static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + internal static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ internal struct APIHelper { return destination } - internal static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + internal static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - internal static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + internal static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ internal struct APIHelper { } internal static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - internal static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + internal static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ internal struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift index 743d9aa443a1..8f6a50857cc7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation internal class PetstoreClientAPI { internal static var basePath = "http://petstore.swagger.io:80/v2" internal static var credential: URLCredential? - internal static var customHeaders: [String: String] = [:] + internal static var customHeaders: [String:String] = [:] internal static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() internal static var apiResponseQueue: DispatchQueue = .main } internal class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - internal let parameters: [String: Any]? + var headers: [String:String] + internal let parameters: [String:Any]? internal let isBody: Bool internal let method: String internal let URLString: String @@ -25,9 +25,9 @@ internal class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - internal var onProgressReady: ((Progress) -> Void)? + internal var onProgressReady: ((Progress) -> ())? - required internal init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required internal init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ internal class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - internal func addHeaders(_ aHeaders: [String: String]) { + internal func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ internal class RequestBuilder { internal protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 174e6c12aedd..81f23f107ad6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ internal class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + internal class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): 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 ab1b8f092475..e52322c01c51 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 @@ -7,6 +7,8 @@ import Foundation + + internal class FakeAPI { /** @@ -14,7 +16,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + internal class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +51,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +86,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + internal class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +121,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + internal class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +156,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +192,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +231,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + internal class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +281,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - 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, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + 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, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(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).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -316,7 +318,7 @@ internal class FakeAPI { internal class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ internal class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -424,7 +426,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -452,19 +454,19 @@ internal class FakeAPI { internal class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -490,7 +492,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -516,13 +518,13 @@ internal class FakeAPI { internal class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ internal class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - internal class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + internal class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -580,7 +582,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -601,14 +603,14 @@ internal class FakeAPI { internal class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 548c5fb35236..969fc92e025d 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + internal class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ internal class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + internal class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 4802f256c100..07228f009cd8 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + internal class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ internal class PetAPI { internal class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -154,7 +156,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -178,8 +180,8 @@ internal class PetAPI { internal class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -197,7 +199,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + internal class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -224,8 +226,8 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -240,7 +242,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -281,7 +283,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -309,14 +311,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -333,7 +335,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -361,14 +363,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -385,7 +387,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -413,14 +415,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f1e423111d09..528a19a9032b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ internal class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + internal class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ internal class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - internal class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + internal class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + internal class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ internal class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + internal class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index c8d714e89916..298a7fee4850 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + internal class UserAPI { /** Create user @@ -15,7 +17,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +54,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +90,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +126,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -148,8 +150,8 @@ internal class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -164,7 +166,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + internal class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -187,8 +189,8 @@ internal class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -204,7 +206,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + internal class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,11 +228,11 @@ internal class UserAPI { internal class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -245,7 +247,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -264,8 +266,8 @@ internal class UserAPI { internal class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -281,7 +283,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + internal class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index f14bd48aced6..cced20209751 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ internal class CodableHelper { internal class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 4dfbe7b0cde7..400d8bd126c7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation internal class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") internal static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e5511b3aa373..f7550a684a7a 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - internal mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + internal mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - internal mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + internal mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - internal mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + internal mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - internal mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + internal mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - internal func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + internal func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - internal func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + internal func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - internal func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + internal func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index 6b69f3b1bd50..332e960ac68c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ internal struct JSONDataEncoding { } internal static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 7d8f433dfea7..47329d53ee41 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation internal class JSONEncodingHelper { - internal class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + internal class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ internal class JSONEncodingHelper { } internal class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ internal class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift index 435d9ce447a0..8a973c8340e0 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -internal enum ErrorResponse: Error { +internal enum ErrorResponse : Error { case error(Int, Data?, Error) } -internal enum DownloadException: Error { +internal enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ internal enum DecodableRequestBuilderError: Error { case generalError(Error) } + internal class Response { internal let statusCode: Int internal let header: [String: String] @@ -43,7 +44,7 @@ internal class Response { internal convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index b4d5ae6faf93..c8876320f47a 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -internal struct AdditionalPropertiesClass: Codable { - internal var mapString: [String: String]? - internal var mapMapString: [String: [String: String]]? +internal struct AdditionalPropertiesClass: Codable { - internal init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + internal var mapString: [String:String]? + internal var mapMapString: [String:[String:String]]? + + internal init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index ada7f86de509..20d157f4ebcb 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Animal: Codable { + +internal struct Animal: Codable { + internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index 3ebe9e9a5dea..9c570350859f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + internal typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index b60d8999b4b2..88b4b69c1668 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ApiResponse: Codable { + +internal struct ApiResponse: Codable { + internal var code: Int? internal var type: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 67371b816b30..3e8bc3da83b1 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ArrayOfArrayOfNumberOnly: Codable { + +internal struct ArrayOfArrayOfNumberOnly: Codable { + internal var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ internal struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 2c7047eac4b0..8e92c78e4da3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ArrayOfNumberOnly: Codable { + +internal struct ArrayOfNumberOnly: Codable { + internal var arrayNumber: [Double]? @@ -15,7 +17,7 @@ internal struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 9c3a3a9f5e1f..d7916cf20b9c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ArrayTest: Codable { + +internal struct ArrayTest: Codable { + internal var arrayOfString: [String]? internal var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ internal struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 965ec5aefba3..17221a54edb6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Capitalization: Codable { + +internal struct Capitalization: Codable { + internal var smallCamel: String? internal var capitalCamel: String? @@ -26,7 +28,7 @@ internal struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 8a603dee5f1f..28292469ddae 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Cat: Codable { + +internal struct Cat: Codable { + internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 45b7dbb26dcf..cdcb1aa14b57 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -internal struct CatAllOf: Codable { + +internal struct CatAllOf: Codable { + internal var declawed: Bool? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 849bf788dfb3..9b061937e091 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Category: Codable { + +internal struct Category: Codable { + internal var id: Int64? internal var name: String = "default-name" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 0f1bc19fe595..034cbadc8dd6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -internal struct ClassModel: Codable { +internal struct ClassModel: Codable { + internal var _class: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index ddee836043fa..e33907ca3a3c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Client: Codable { + +internal struct Client: Codable { + internal var client: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 6b5250de4a4a..3d45b8ac7a13 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Dog: Codable { + +internal struct Dog: Codable { + internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index ef3ff7f1d78b..6fb9a0505161 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -internal struct DogAllOf: Codable { + +internal struct DogAllOf: Codable { + internal var breed: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index bb9f64cfb438..8aa9c2bd58d2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -internal struct EnumArrays: Codable { + +internal struct EnumArrays: Codable { + internal enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ internal struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 71fd29e0d2a5..07dfc16a69f2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + internal enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 421aa5436b04..4081beae4c0a 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -internal struct EnumTest: Codable { + +internal struct EnumTest: Codable { + internal enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ internal struct EnumTest: Codable { self.outerEnum = outerEnum } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 632402fb9e03..166138041ecf 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -internal struct File: Codable { +internal struct File: Codable { + /** Test capitalization */ internal var sourceURI: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index e478e6c4b7d1..2245e94bcc90 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -internal struct FileSchemaTestClass: Codable { + +internal struct FileSchemaTestClass: Codable { + internal var file: File? internal var files: [File]? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 23395c93b569..30b11efb2e19 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -internal struct FormatTest: Codable { + +internal struct FormatTest: Codable { + internal var integer: Int? internal var int32: Int? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 831963ba2ed2..d51b4421dfe6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -internal struct HasOnlyReadOnly: Codable { + +internal struct HasOnlyReadOnly: Codable { + internal var bar: String? internal var foo: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift index c5960de21513..0a76cba0ed92 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -internal struct List: Codable { + +internal struct List: Codable { + internal var _123list: String? @@ -15,7 +17,7 @@ internal struct List: Codable { self._123list = _123list } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index db4f8f436aa5..b0a860092bc6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -internal struct MapTest: Codable { + +internal struct MapTest: Codable { + internal enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - internal var mapMapOfString: [String: [String: String]]? - internal var mapOfEnumString: [String: String]? - internal var directMap: [String: Bool]? + internal var mapMapOfString: [String:[String:String]]? + internal var mapOfEnumString: [String:String]? + internal var directMap: [String:Bool]? internal var indirectMap: StringBooleanMap? - internal init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + internal init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c71bb9256b0a..c6fa4baaecd7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + internal var uuid: UUID? internal var dateTime: Date? - internal var map: [String: Animal]? + internal var map: [String:Animal]? - internal init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + internal init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 5d31a885f751..2a81b0ac9273 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -internal struct Model200Response: Codable { +internal struct Model200Response: Codable { + internal var name: Int? internal var _class: String? @@ -18,7 +19,7 @@ internal struct Model200Response: Codable { self._class = _class } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 2aa8fb1524c3..5c7df2148768 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -internal struct Name: Codable { +internal struct Name: Codable { + internal var name: Int internal var snakeCase: Int? @@ -22,7 +23,7 @@ internal struct Name: Codable { self._123number = _123number } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 49d73706e398..3473e7016447 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -internal struct NumberOnly: Codable { + +internal struct NumberOnly: Codable { + internal var justNumber: Double? @@ -15,7 +17,7 @@ internal struct NumberOnly: Codable { self.justNumber = justNumber } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index dcefb40efa2b..b6fd07e148b5 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Order: Codable { + +internal struct Order: Codable { + internal enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index c61c2c4a4620..592f9a849ce3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -internal struct OuterComposite: Codable { + +internal struct OuterComposite: Codable { + internal var myNumber: Double? internal var myString: String? @@ -19,7 +21,7 @@ internal struct OuterComposite: Codable { self.myBoolean = myBoolean } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index e0cdcbea0558..ab1397d4f31d 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + internal enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b71700544d06..0cf0f0d3b4b5 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Pet: Codable { + +internal struct Pet: Codable { + internal enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index d02c6cc5fd9f..8792cf4aa754 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -internal struct ReadOnlyFirst: Codable { + +internal struct ReadOnlyFirst: Codable { + internal var bar: String? internal var baz: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 95a18b571ade..82b73db4b37e 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -internal struct Return: Codable { +internal struct Return: Codable { + internal var _return: Int? @@ -16,7 +17,7 @@ internal struct Return: Codable { self._return = _return } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index b6ac3651f0e7..e98a8fd7955c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -internal struct SpecialModelName: Codable { + +internal struct SpecialModelName: Codable { + internal var specialPropertyName: Int64? @@ -15,7 +17,7 @@ internal struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index dc3d00e13014..d1afe6732a46 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -internal struct StringBooleanMap: Codable { - internal var additionalProperties: [String: Bool] = [:] +internal struct StringBooleanMap: Codable { + + + + internal var additionalProperties: [String:Bool] = [:] internal subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ internal struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 1e4de951fb2c..923acc9b1f69 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -internal struct Tag: Codable { + +internal struct Tag: Codable { + internal var id: Int64? internal var name: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 83908bb4fc94..e78ae839f503 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -internal struct TypeHolderDefault: Codable { + +internal struct TypeHolderDefault: Codable { + internal var stringItem: String = "what" internal var numberItem: Double @@ -23,7 +25,7 @@ internal struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 3e2c6193aa3e..c829014f0d44 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -internal struct TypeHolderExample: Codable { + +internal struct TypeHolderExample: Codable { + internal var stringItem: String internal var numberItem: Double @@ -23,7 +25,7 @@ internal struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift index ada8a7f82d96..c2865a579220 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -internal struct User: Codable { + +internal struct User: Codable { + internal var id: Int64? internal var username: String? 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 b8cfe114dc55..9ddbca74f945 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() internal class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ internal class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ internal var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required internal init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required internal init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ internal class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - internal func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + internal func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ internal class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ internal class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ internal class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } -internal class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +internal class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ internal class URLSessionDecodableRequestBuilder: URLSessionReques switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ internal class URLSessionDecodableRequestBuilder: URLSessionReques } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ internal protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ private class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/objcCompatible/Package.swift b/samples/client/petstore/swift5/objcCompatible/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/objcCompatible/Package.swift +++ b/samples/client/petstore/swift5/objcCompatible/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift index e4cbda9c725d..6ee6f8f43c60 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 2e9ad96a66b5..41731036ab60 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,7 +7,9 @@ import Foundation -@objc open class AnotherFakeAPI: NSObject { + + +@objc open class AnotherFakeAPI : NSObject { /** To test special tags @@ -15,7 +17,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): 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 6483ab29bcc3..fc51b0022277 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 @@ -7,14 +7,16 @@ import Foundation -@objc open class FakeAPI: NSObject { + + +@objc open class FakeAPI : NSObject { /** - parameter body: (body) Input boolean as post body (optional) - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +51,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +86,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +121,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +156,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +192,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +231,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +281,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(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).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -316,7 +318,7 @@ import Foundation open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ import Foundation let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -424,7 +426,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -452,19 +454,19 @@ import Foundation open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -490,7 +492,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -516,13 +518,13 @@ import Foundation open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ import Foundation - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -580,7 +582,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -601,14 +603,14 @@ import Foundation open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index b9cfc75eeb4c..3793f6dc4128 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,7 +7,9 @@ import Foundation -@objc open class FakeClassnameTags123API: NSObject { + + +@objc open class FakeClassnameTags123API : NSObject { /** To test class name in snake case @@ -15,7 +17,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index e1708decd35b..b75d1fa8deda 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,7 +7,9 @@ import Foundation -@objc open class PetAPI: NSObject { + + +@objc open class PetAPI : NSObject { /** Add a new pet to the store @@ -15,7 +17,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ import Foundation open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -154,7 +156,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -178,8 +180,8 @@ import Foundation open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -197,7 +199,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -224,8 +226,8 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -240,7 +242,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -281,7 +283,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -309,14 +311,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -333,7 +335,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -361,14 +363,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -385,7 +387,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -413,14 +415,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index a19d12c7d24b..cc15cd3ae88c 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,7 +7,9 @@ import Foundation -@objc open class StoreAPI: NSObject { + + +@objc open class StoreAPI : NSObject { /** Delete purchase order by ID @@ -15,7 +17,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ import Foundation let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ import Foundation - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ import Foundation let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 4dfe4da1a021..6e0e10bc7b22 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,7 +7,9 @@ import Foundation -@objc open class UserAPI: NSObject { + + +@objc open class UserAPI : NSObject { /** Create user @@ -15,7 +17,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +54,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +90,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +126,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -148,8 +150,8 @@ import Foundation let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -164,7 +166,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -187,8 +189,8 @@ import Foundation let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -204,7 +206,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,11 +228,11 @@ import Foundation open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -245,7 +247,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -264,8 +266,8 @@ import Foundation open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -281,7 +283,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee12..4dc1d70aeb52 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index 4dd8815847c6..9bf69037bf03 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index e184d7691799..d4e1b3697e71 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -@objc public class AdditionalPropertiesClass: NSObject, Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { +@objc public class AdditionalPropertiesClass: NSObject, Codable { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 88152934da2b..f34ba3bb63e7 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Animal: NSObject, Codable { + + +@objc public class Animal: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -17,7 +19,7 @@ import Foundation self.color = color } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _className = "className" case color } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index d0fcd4368854..d9a7fae21446 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ApiResponse: NSObject, Codable { + + +@objc public class ApiResponse: NSObject, Codable { public var code: Int? public var codeNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 9e3f3aba246a..e57e63b6ed28 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable { + + +@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable { public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ import Foundation self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index d287cc1563aa..e087329fdc44 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ArrayOfNumberOnly: NSObject, Codable { + + +@objc public class ArrayOfNumberOnly: NSObject, Codable { public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ import Foundation self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index dcc3e9c3dd51..c7e6b0b27a4b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ArrayTest: NSObject, Codable { + + +@objc public class ArrayTest: NSObject, Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ import Foundation self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 80a5667445f2..e472eaaa7916 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Capitalization: NSObject, Codable { + + +@objc public class Capitalization: NSObject, Codable { public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ import Foundation self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 78de5a909f54..1b19800ae3c3 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Cat: NSObject, Codable { + + +@objc public class Cat: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -24,7 +26,7 @@ import Foundation self.declawed = declawed } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _className = "className" case color case declawed diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index ef8cec45aff1..8758762c40bf 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class CatAllOf: NSObject, Codable { + + +@objc public class CatAllOf: NSObject, Codable { public var declawed: Bool? public var declawedNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 0610c10c982f..df7771efc457 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Category: NSObject, Codable { + + +@objc public class Category: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -22,7 +24,7 @@ import Foundation self.name = name } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case name } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 4197ffcaed6c..c221ccf2a0de 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -@objc public class ClassModel: NSObject, Codable { +@objc public class ClassModel: NSObject, Codable { public var _class: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 517dbbba2ec2..5aea86fbb06e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Client: NSObject, Codable { + + +@objc public class Client: NSObject, Codable { public var client: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 37733cd1f3be..464f0c7ae4e7 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Dog: NSObject, Codable { + + +@objc public class Dog: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -19,7 +21,7 @@ import Foundation self.breed = breed } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _className = "className" case color case breed diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 73fd1822725c..efcd880f10b3 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class DogAllOf: NSObject, Codable { + + +@objc public class DogAllOf: NSObject, Codable { public var breed: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 034a58c6c0eb..3c1c26139314 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class EnumArrays: NSObject, Codable { + + +@objc public class EnumArrays: NSObject, Codable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ import Foundation self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index ce3a03006097..60b754914d42 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class EnumTest: NSObject, Codable { + + +@objc public class EnumTest: NSObject, Codable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ import Foundation self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 7a320c177d38..120d5bb78797 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -9,7 +9,7 @@ import Foundation /** Must be named `File` for test. */ -@objc public class File: NSObject, Codable { +@objc public class File: NSObject, Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index a6437b4fe901..e60109a85334 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class FileSchemaTestClass: NSObject, Codable { + + +@objc public class FileSchemaTestClass: NSObject, Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index df2c46d3757b..664481c02fc4 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class FormatTest: NSObject, Codable { + + +@objc public class FormatTest: NSObject, Codable { public var integer: Int? public var integerNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index b9f5b39117d7..974726b3e65d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class HasOnlyReadOnly: NSObject, Codable { + + +@objc public class HasOnlyReadOnly: NSObject, Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 826dc9e27f2b..4942b7502244 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class List: NSObject, Codable { + + +@objc public class List: NSObject, Codable { public var _123list: String? @@ -15,7 +17,7 @@ import Foundation self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 2b97660b80e8..2acd08f46a45 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -@objc public class MapTest: NSObject, Codable { + + +@objc public class MapTest: NSObject, Codable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index e10adad0a7e1..3ecb79bf9f43 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { + + +@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 1c5410f61dde..031badf4be9e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model name starting with number */ -@objc public class Model200Response: NSObject, Codable { +@objc public class Model200Response: NSObject, Codable { public var name: Int? public var nameNum: NSNumber? { @@ -24,7 +24,7 @@ import Foundation self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 06f8a2f81a3a..c863b854d468 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model name same as property name */ -@objc public class Name: NSObject, Codable { +@objc public class Name: NSObject, Codable { public var name: Int public var snakeCase: Int? @@ -33,7 +33,7 @@ import Foundation self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 3bd9859378d8..1db3ace43047 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class NumberOnly: NSObject, Codable { + + +@objc public class NumberOnly: NSObject, Codable { public var justNumber: Double? @@ -15,7 +17,7 @@ import Foundation self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 586a4c2d55a8..5fdd493dbedb 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Order: NSObject, Codable { + + +@objc public class Order: NSObject, Codable { public enum Status: String, Codable, CaseIterable { case placed = "placed" @@ -51,7 +53,7 @@ import Foundation self.complete = complete } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case petId case quantity diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 434111678de7..0d1791d3fa8d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class OuterComposite: NSObject, Codable { + + +@objc public class OuterComposite: NSObject, Codable { public var myNumber: Double? public var myString: String? @@ -24,7 +26,7 @@ import Foundation self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index d84079a2b48d..29d4e3d9e37a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Pet: NSObject, Codable { + + +@objc public class Pet: NSObject, Codable { public enum Status: String, Codable, CaseIterable { case available = "available" @@ -36,7 +38,7 @@ import Foundation self.status = status } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case category case name diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index d1252433b2d8..2c806ac6d756 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class ReadOnlyFirst: NSObject, Codable { + + +@objc public class ReadOnlyFirst: NSObject, Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 4b10ac18cf0d..948f6f4d3846 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing reserved words */ -@objc public class Return: NSObject, Codable { +@objc public class Return: NSObject, Codable { public var _return: Int? public var _returnNum: NSNumber? { @@ -22,7 +22,7 @@ import Foundation self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 85e33352531d..c01c4065998b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class SpecialModelName: NSObject, Codable { + + +@objc public class SpecialModelName: NSObject, Codable { public var specialPropertyName: Int64? public var specialPropertyNameNum: NSNumber? { @@ -20,7 +22,7 @@ import Foundation self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index ffe9730a6fe4..3116d99bff0c 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -@objc public class StringBooleanMap: NSObject, Codable { - public var additionalProperties: [String: Bool] = [:] + +@objc public class StringBooleanMap: NSObject, Codable { + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ import Foundation additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 88583be7f5dd..1bd7489826dd 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class Tag: NSObject, Codable { + + +@objc public class Tag: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -22,7 +24,7 @@ import Foundation self.name = name } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case name } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 6d51f44540c0..273b7b31aefd 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class TypeHolderDefault: NSObject, Codable { + + +@objc public class TypeHolderDefault: NSObject, Codable { public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ import Foundation self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 40e3a41c34d9..3cb1929d4394 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class TypeHolderExample: NSObject, Codable { + + +@objc public class TypeHolderExample: NSObject, Codable { public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ import Foundation self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 7dc3cc5954d6..eb8ec0552741 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -@objc public class User: NSObject, Codable { + + +@objc public class User: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -40,7 +42,7 @@ import Foundation self.userStatus = userStatus } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case username case firstName 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 ad5f58eea436..fb57e03ff8dd 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ private class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/promisekitLibrary/Package.swift b/samples/client/petstore/swift5/promisekitLibrary/Package.swift index 4445c9794907..10dac4053846 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/Package.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/Package.swift @@ -14,19 +14,19 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.12.0") + .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.12.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "PetstoreClient", - dependencies: ["PromiseKit" ], + dependencies: ["PromiseKit", ], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index e4cbda9c725d..6ee6f8f43c60 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index c3a97ff074c1..ffce4d7c4e81 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class AnotherFakeAPI { /** To test special tags 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 80153ba634d3..47b6ec5f196f 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 @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class FakeAPI { /** @@ -201,7 +203,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testBodyWithQueryParams( query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testBodyWithQueryParams( query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { @@ -294,7 +296,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testEndpointParametersWithRequestBuilder(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).execute(apiResponseQueue) { result -> Void in switch result { @@ -333,7 +335,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -352,7 +354,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -441,7 +443,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { @@ -471,19 +473,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -509,7 +511,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { @@ -537,13 +539,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -564,7 +566,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testInlineAdditionalProperties( param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testInlineAdditionalProperties( param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { @@ -583,7 +585,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -603,7 +605,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testJsonFormData( param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testJsonFormData( param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { @@ -626,14 +628,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 3a05f8eaf60e..e749c654de5c 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 4514fc8f107b..621e228787b7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class PetAPI { /** Add a new pet to the store @@ -58,7 +60,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func deletePet( petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func deletePet( petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { @@ -87,8 +89,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -142,8 +144,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -187,8 +189,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -235,8 +237,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -294,7 +296,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { @@ -324,14 +326,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -348,7 +350,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { @@ -378,14 +380,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -402,7 +404,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { @@ -432,14 +434,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 20fc8a1468c7..9bb66f3699f7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class StoreAPI { /** Delete purchase order by ID @@ -42,8 +44,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -57,8 +59,8 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise<[String:Int]> */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise<[String: Int]> { - let deferred = Promise<[String: Int]>.pending() + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise<[String:Int]> { + let deferred = Promise<[String:Int]>.pending() getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -79,14 +81,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -124,8 +126,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 89c48c3b28f8..237961c96a08 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,6 +8,8 @@ import Foundation import PromiseKit + + open class UserAPI { /** Create user @@ -157,8 +159,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -198,8 +200,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -215,7 +217,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func loginUser( username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func loginUser( username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { @@ -239,11 +241,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -279,8 +281,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -296,7 +298,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func updateUser( username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func updateUser( username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee12..4dc1d70aeb52 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 736702ea5dd9..5b98ba296730 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -109,24 +109,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -136,7 +136,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -148,8 +148,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -158,8 +158,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -180,7 +180,7 @@ extension HTTPURLResponse { } extension RequestBuilder { - public func execute() -> Promise> { + public func execute() -> Promise> { let deferred = Promise>.pending() self.execute { result in switch result { diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 4dd8815847c6..9bf69037bf03 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? 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 ad5f58eea436..fb57e03ff8dd 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ private class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/resultLibrary/Package.swift b/samples/client/petstore/swift5/resultLibrary/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/resultLibrary/Package.swift +++ b/samples/client/petstore/swift5/resultLibrary/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index e4cbda9c725d..6ee6f8f43c60 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 869f1ccd251a..49ba99122021 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags 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 2764fb314ab0..bc862e4651dd 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 @@ -7,6 +7,8 @@ import Foundation + + open class FakeAPI { /** @@ -316,7 +318,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -452,19 +454,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -516,13 +518,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -601,14 +603,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 5f21b82aa35a..86552eb286bc 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index a9c5c89eb1c6..0fe4f4c252a9 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -82,8 +84,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -135,8 +137,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -178,8 +180,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -224,8 +226,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -309,14 +311,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -361,14 +363,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -413,14 +415,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f67d192fa914..9c94c3098388 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -39,8 +41,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result<[String: Int], Error>) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result<[String:Int], Error>) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -117,8 +119,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 930d55d9428e..52a63c48d1e7 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -148,8 +150,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -187,8 +189,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -226,11 +228,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -264,8 +266,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee12..4dc1d70aeb52 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 4dd8815847c6..9bf69037bf03 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? 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 ad5f58eea436..fb57e03ff8dd 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ private class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/rxswiftLibrary/Package.swift b/samples/client/petstore/swift5/rxswiftLibrary/Package.swift index 24f9a6c99ae5..4b20458197f3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/Package.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/Package.swift @@ -14,11 +14,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0") + .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -27,6 +27,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["RxSwift"], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index e4cbda9c725d..6ee6f8f43c60 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 792371b38421..4090e37b32c9 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class AnotherFakeAPI { /** To test special tags 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 3e9b32438c82..fa3d09834ff0 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 @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class FakeAPI { /** @@ -349,7 +351,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -368,7 +370,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -489,19 +491,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -557,13 +559,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -584,7 +586,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Observable */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { @@ -605,7 +607,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -650,14 +652,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 989a914f3795..1353f91b278f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 42bafcffce16..6abd80254ddd 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class PetAPI { /** Add a new pet to the store @@ -91,8 +93,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -148,8 +150,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -195,8 +197,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -245,8 +247,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -338,14 +340,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -394,14 +396,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -450,14 +452,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index dea3933433cf..f5c974ba3824 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class StoreAPI { /** Delete purchase order by ID @@ -44,8 +46,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -59,7 +61,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Observable<[String:Int]> */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[String: Int]> { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[String:Int]> { return Observable.create { observer -> Disposable in getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { @@ -83,14 +85,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -130,8 +132,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 3447ea28c0ed..2228363cfccd 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,6 +8,8 @@ import Foundation import RxSwift + + open class UserAPI { /** Create user @@ -165,8 +167,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -208,8 +210,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -251,11 +253,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -293,8 +295,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee12..4dc1d70aeb52 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 4dd8815847c6..9bf69037bf03 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? 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 ad5f58eea436..fb57e03ff8dd 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ private class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Package.swift b/samples/client/petstore/swift5/urlsessionLibrary/Package.swift index 96dfff54edf4..79f6f8188738 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Package.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index e4cbda9c725d..6ee6f8f43c60 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 5bbf323f820c..bb3ae7178254 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): 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 134d6aea416a..d1d81faa335c 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 @@ -7,6 +7,8 @@ import Foundation + + open class FakeAPI { /** @@ -14,7 +16,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +51,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +86,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +121,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +156,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +192,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +231,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +281,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(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).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -316,7 +318,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -424,7 +426,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -452,19 +454,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -490,7 +492,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -516,13 +518,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -580,7 +582,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -601,14 +603,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 48cfe7187b9a..d21c4a49d43d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0552d4a6c16e..496da91171ac 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -154,7 +156,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -178,8 +180,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -197,7 +199,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -224,8 +226,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -240,7 +242,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -281,7 +283,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -309,14 +311,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -333,7 +335,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -361,14 +363,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -385,7 +387,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -413,14 +415,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index a8a83eda39a4..3848eda85ad6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 505ed1b0c5c9..546166841d9e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -15,7 +17,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +54,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +90,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +126,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -148,8 +150,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -164,7 +166,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -187,8 +189,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -204,7 +206,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,11 +228,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -245,7 +247,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -264,8 +266,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -281,7 +283,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee12..4dc1d70aeb52 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 4dd8815847c6..9bf69037bf03 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 1af031535967..28ca8377b889 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 5ed9f31e2a36..1050d79dbe9d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efdc8..e7bea63f8ed2 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index ec270da89074..4d0393b9ba45 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 6c252ed475b2..1363c96394ba 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e84eb5d65025..6b8873730c43 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d2140933d181..64f7c6d9db99 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index d1b3b27616ed..ddb669a59045 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7ab887f3113f..c4f6e0d488ca 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index a51ad0dffab1..7b1d7e32be80 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + public var declawed: Bool? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index eb8f7e5e1974..3ec00f5ab10d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e2a7d4427a06..af030c3dd626 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + public var _class: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 00245ca37280..0aae748c76b4 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + public var client: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 492c1228008e..198e28b94dd6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 7786f8acc5ae..8ff49b2af23f 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + public var breed: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 9844e7c40e35..e2d3fa04f94b 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8af..c2c639ba3246 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 789f583e1d77..a56e1f36389b 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index abf3ccffc485..773b53b2cb76 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 532f1457939a..83dc1148cfa3 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 20bd6d103b3d..bccd3f9fb178 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 906ddb06fb17..566d71a35ef0 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index fe13d302ccbf..80cecab242f2 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 4b6037f378ee..f0c02de95f7a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c3deb2f28932..710e62a9b587 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index b61db7d6e716..450a53b918ca 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 8ab4db44b73a..6deb69fcd731 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 4d1dafcc2c1f..0c9ee2b7b9f4 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 40c30cc8609c..ab0eac0b304e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 18c3a024f122..4a7d22710441 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbed4..9e6b8d74e874 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b9ce0e933256..a973071d6c96 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 0acd21fd1000..b2a6b7e2b8a6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index c223f993a69e..7e089dcee2b4 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 6e8650f76d8e..e890ef952520 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3f1237fee477..f65ae0623d6e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 4dd8a9a9f5a0..a91b6061bcf7 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index a9e088808ed3..2d377c3edb02 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index dff4083ae432..e5eb92da696e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 79f271ed7356..f70328ca9e59 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? 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 ad5f58eea436..fb57e03ff8dd 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ private class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/test/swift4/default/Package.swift b/samples/client/test/swift4/default/Package.swift index a2afb320f9aa..407794321158 100644 --- a/samples/client/test/swift4/default/Package.swift +++ b/samples/client/test/swift4/default/Package.swift @@ -9,11 +9,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "TestClient", - targets: ["TestClient"]) + targets: ["TestClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -22,6 +22,6 @@ let package = Package( name: "TestClient", dependencies: ["Alamofire"], path: "TestClient/Classes" - ) + ), ] ) diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift index b8c1ec2d40df..c8b83db00d5f 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class TestClientAPI { public static var basePath = "http://api.example.com/basePath" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(TestClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift index 22b7b0f9d96e..84ce8abdbf0e 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class Swift4TestAPI { /** Get all of the models @@ -14,7 +16,7 @@ open class Swift4TestAPI { - parameter clientId: (query) id that represent the Api client - parameter completion: completion handler to receive the data and the error objects */ - open class func getAllModels(clientId: String, completion: @escaping ((_ data: GetAllModelsResult?, _ error: Error?) -> Void)) { + open class func getAllModels(clientId: String, completion: @escaping ((_ data: GetAllModelsResult?,_ error: Error?) -> Void)) { getAllModelsWithRequestBuilder(clientId: clientId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -30,8 +32,8 @@ open class Swift4TestAPI { open class func getAllModelsWithRequestBuilder(clientId: String) -> RequestBuilder { let path = "/allModels" let URLString = TestClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "client_id": clientId.encodeToJSON() diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift index 1487a4730f70..56b66b0f1402 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString + let managerId:String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,7 +111,8 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { + } + else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -275,7 +276,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -283,7 +284,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename: String? + var filename : String? = nil for contentItem in items { @@ -294,7 +295,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -303,7 +304,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -317,7 +318,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -328,7 +329,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -private enum DownloadException: Error { +fileprivate enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -343,7 +344,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -435,7 +436,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild return } - var responseObj: Response? + var responseObj: Response? = nil let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift index 27cf29c65600..57bab28b1998 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T: Encodable { + open class func encode(_ value: T) -> EncodeResult where T : Encodable { var returnedData: Data? - var returnedError: Error? + var returnedError: Error? = nil do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} +} \ No newline at end of file diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift index e1ecb39726e7..516590da5d9e 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift index 74fcfcf2ad49..1f948ae12f78 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,3 +171,5 @@ extension KeyedDecodingContainerProtocol { } } + + diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index fb76bbed26f7..ca05906d4206 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? + var returnedParams: Parameters? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 827bdec87782..6ae673e1f8ca 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? + var params: Parameters? = nil if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift index 25161165865e..408563890359 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift index 64073972bc6e..88cfe74154f0 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift @@ -8,7 +8,8 @@ import Foundation /** Object which contains lots of different primitive OpenAPI types */ -public struct AllPrimitives: Codable { +public struct AllPrimitives: Codable { + public enum MyInlineStringEnum: String, Codable { case inlinestringenumvalue1 = "inlineStringEnumValue1" diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift index 2ffb3a5e1ab9..4e82fadd2eee 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift @@ -8,7 +8,8 @@ import Foundation /** This is a base card object which uses a 'cardType' discriminator. */ -public struct BaseCard: Codable { +public struct BaseCard: Codable { + public var cardType: String diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift index c2b1fcda5868..8b512aa78baf 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift @@ -8,7 +8,8 @@ import Foundation /** Example Error object */ -public struct ErrorInfo: Codable { +public struct ErrorInfo: Codable { + public var code: Int? public var message: String? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift index b8cfedbe94af..9cdaac272756 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift @@ -8,7 +8,8 @@ import Foundation /** Response object containing AllPrimitives object */ -public struct GetAllModelsResult: Codable { +public struct GetAllModelsResult: Codable { + public var myPrimitiveArray: [AllPrimitives]? public var myPrimitive: AllPrimitives? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift index 2878543406a4..600a23f206ca 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift @@ -8,9 +8,11 @@ import Foundation /** This is an empty model with no properties and only additionalProperties of type int32 */ -public struct ModelWithIntAdditionalPropertiesOnly: Codable { +public struct ModelWithIntAdditionalPropertiesOnly: Codable { - public var additionalProperties: [String: Int] = [:] + + + public var additionalProperties: [String:Int] = [:] public subscript(key: String) -> Int? { get { @@ -43,4 +45,5 @@ public struct ModelWithIntAdditionalPropertiesOnly: Codable { additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift index d8f115cb4998..606429c8bd21 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift @@ -8,7 +8,8 @@ import Foundation /** This is an empty model with no properties and only additionalProperties of type int32 */ -public struct ModelWithPropertiesAndAdditionalProperties: Codable { +public struct ModelWithPropertiesAndAdditionalProperties: Codable { + public var myIntegerReq: Int public var myIntegerOpt: Int? @@ -29,7 +30,7 @@ public struct ModelWithPropertiesAndAdditionalProperties: Codable { self.myPrimitiveArrayReq = myPrimitiveArrayReq self.myPrimitiveArrayOpt = myPrimitiveArrayOpt } - public var additionalProperties: [String: String] = [:] + public var additionalProperties: [String:String] = [:] public subscript(key: String) -> String? { get { @@ -86,4 +87,5 @@ public struct ModelWithPropertiesAndAdditionalProperties: Codable { additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift index fffed8885315..a23c9c9aa0b6 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift @@ -8,9 +8,11 @@ import Foundation /** This is an empty model with no properties and only additionalProperties of type string */ -public struct ModelWithStringAdditionalPropertiesOnly: Codable { +public struct ModelWithStringAdditionalPropertiesOnly: Codable { - public var additionalProperties: [String: String] = [:] + + + public var additionalProperties: [String:String] = [:] public subscript(key: String) -> String? { get { @@ -43,4 +45,5 @@ public struct ModelWithStringAdditionalPropertiesOnly: Codable { additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift index db1a081b275d..6c50ccc4ca16 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift @@ -8,7 +8,8 @@ import Foundation /** This is a card object for a Person derived from BaseCard. */ -public struct PersonCard: Codable { +public struct PersonCard: Codable { + public var cardType: String public var firstName: String? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift index e11d38985a2e..8ff2db3bd880 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct PersonCardAllOf: Codable { + +public struct PersonCardAllOf: Codable { + public var firstName: String? public var lastName: String? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift index 0fd94cf83640..63abaeda4bd8 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift @@ -8,7 +8,8 @@ import Foundation /** This is a card object for a Person derived from BaseCard. */ -public struct PlaceCard: Codable { +public struct PlaceCard: Codable { + public var cardType: String public var placeName: String? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift index c5e89a15e00f..9f1da50fd576 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct PlaceCardAllOf: Codable { + +public struct PlaceCardAllOf: Codable { + public var placeName: String? public var placeAddress: String? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift index 7d884d88e185..9ef4613093d8 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift @@ -8,7 +8,8 @@ import Foundation /** This is a base class object from which other classes will derive. */ -public struct SampleBase: Codable { +public struct SampleBase: Codable { + public var baseClassStringProp: String? public var baseClassIntegerProp: Int? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift index c6ffc74a959d..1f8fe4e60982 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift @@ -8,7 +8,8 @@ import Foundation /** This is a subclass defived from the SampleBase class. */ -public struct SampleSubClass: Codable { +public struct SampleSubClass: Codable { + public var baseClassStringProp: String? public var baseClassIntegerProp: Int? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift index 7f52bb9fef4c..08ad426146a5 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct SampleSubClassAllOf: Codable { + +public struct SampleSubClassAllOf: Codable { + public var subClassStringProp: String? public var subClassIntegerProp: Int? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift index 67c1c22deda7..d4cce19e6d6d 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum StringEnum: String, Codable { case stringenumvalue1 = "stringEnumValue1" case stringenumvalue2 = "stringEnumValue2" diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift index 285d86a56941..8b5a61cb132c 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift @@ -8,7 +8,8 @@ import Foundation /** This object contains property names which we know will be different from their variable name. Examples of this include snake case property names and property names which are Swift 4 reserved words. */ -public struct VariableNameTest: Codable { +public struct VariableNameTest: Codable { + /** This snake-case examle_name property name should be converted to a camelCase variable name like exampleName */ public var exampleName: String? @@ -23,7 +24,7 @@ public struct VariableNameTest: Codable { self.normalName = normalName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case exampleName = "example_name" case _for = "for" case normalName diff --git a/samples/client/test/swift4/default/docs/SampleSubClass.md b/samples/client/test/swift4/default/docs/SampleSubClass.md index 435633ccde1c..d32058a5b2c4 100644 --- a/samples/client/test/swift4/default/docs/SampleSubClass.md +++ b/samples/client/test/swift4/default/docs/SampleSubClass.md @@ -3,8 +3,6 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**baseClassStringProp** | **String** | | [optional] -**baseClassIntegerProp** | **Int** | | [optional] **subClassStringProp** | **String** | | [optional] **subClassIntegerProp** | **Int** | | [optional] diff --git a/samples/client/test/swift5/default/Package.swift b/samples/client/test/swift5/default/Package.swift index 25d70eebdedc..1db5df4fd683 100644 --- a/samples/client/test/swift5/default/Package.swift +++ b/samples/client/test/swift5/default/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "TestClient", - targets: ["TestClient"]) + targets: ["TestClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "TestClient", dependencies: [], path: "TestClient/Classes" - ) + ), ] ) diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIHelper.swift index 200070096800..d94614b34fc7 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { + if let collection = item.value as? Array { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs.swift index 359d938d4534..0ab78fdb762c 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class TestClientAPI { public static var basePath = "http://api.example.com/basePath" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(TestClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs/Swift5TestAPI.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs/Swift5TestAPI.swift index 6987b61a1a4d..1995eb9567c9 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs/Swift5TestAPI.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs/Swift5TestAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class Swift5TestAPI { /** Get all of the models @@ -15,7 +17,7 @@ open class Swift5TestAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getAllModels(clientId: String, apiResponseQueue: DispatchQueue = TestClientAPI.apiResponseQueue, completion: @escaping ((_ data: GetAllModelsResult?, _ error: Error?) -> Void)) { + open class func getAllModels(clientId: String, apiResponseQueue: DispatchQueue = TestClientAPI.apiResponseQueue, completion: @escaping ((_ data: GetAllModelsResult?,_ error: Error?) -> Void)) { getAllModelsWithRequestBuilder(clientId: clientId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -36,8 +38,8 @@ open class Swift5TestAPI { open class func getAllModelsWithRequestBuilder(clientId: String) -> RequestBuilder { let path = "/allModels" let URLString = TestClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "client_id": clientId.encodeToJSON() diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee12..4dc1d70aeb52 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Configuration.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Configuration.swift index 627d9adb757e..f171525e4394 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Extensions.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Extensions.swift index 93ed6b90b376..6e279679c67a 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64d5..08f1ef334dff 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb4705..314f1eff1f9b 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models.swift index 4dd8815847c6..9bf69037bf03 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift index dc6571db3e95..68b5bd75ab35 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift @@ -8,7 +8,8 @@ import Foundation /** Object which contains lots of different primitive OpenAPI types */ -public struct AllPrimitives: Codable { +public struct AllPrimitives: Codable { + public enum MyInlineStringEnum: String, Codable, CaseIterable { case inlinestringenumvalue1 = "inlineStringEnumValue1" diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift index 2ffb3a5e1ab9..4e82fadd2eee 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift @@ -8,7 +8,8 @@ import Foundation /** This is a base card object which uses a 'cardType' discriminator. */ -public struct BaseCard: Codable { +public struct BaseCard: Codable { + public var cardType: String diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift index c2b1fcda5868..8b512aa78baf 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift @@ -8,7 +8,8 @@ import Foundation /** Example Error object */ -public struct ErrorInfo: Codable { +public struct ErrorInfo: Codable { + public var code: Int? public var message: String? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift index b8cfedbe94af..9cdaac272756 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift @@ -8,7 +8,8 @@ import Foundation /** Response object containing AllPrimitives object */ -public struct GetAllModelsResult: Codable { +public struct GetAllModelsResult: Codable { + public var myPrimitiveArray: [AllPrimitives]? public var myPrimitive: AllPrimitives? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift index 2878543406a4..600a23f206ca 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift @@ -8,9 +8,11 @@ import Foundation /** This is an empty model with no properties and only additionalProperties of type int32 */ -public struct ModelWithIntAdditionalPropertiesOnly: Codable { +public struct ModelWithIntAdditionalPropertiesOnly: Codable { - public var additionalProperties: [String: Int] = [:] + + + public var additionalProperties: [String:Int] = [:] public subscript(key: String) -> Int? { get { @@ -43,4 +45,5 @@ public struct ModelWithIntAdditionalPropertiesOnly: Codable { additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift index d8f115cb4998..606429c8bd21 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift @@ -8,7 +8,8 @@ import Foundation /** This is an empty model with no properties and only additionalProperties of type int32 */ -public struct ModelWithPropertiesAndAdditionalProperties: Codable { +public struct ModelWithPropertiesAndAdditionalProperties: Codable { + public var myIntegerReq: Int public var myIntegerOpt: Int? @@ -29,7 +30,7 @@ public struct ModelWithPropertiesAndAdditionalProperties: Codable { self.myPrimitiveArrayReq = myPrimitiveArrayReq self.myPrimitiveArrayOpt = myPrimitiveArrayOpt } - public var additionalProperties: [String: String] = [:] + public var additionalProperties: [String:String] = [:] public subscript(key: String) -> String? { get { @@ -86,4 +87,5 @@ public struct ModelWithPropertiesAndAdditionalProperties: Codable { additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift index fffed8885315..a23c9c9aa0b6 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift @@ -8,9 +8,11 @@ import Foundation /** This is an empty model with no properties and only additionalProperties of type string */ -public struct ModelWithStringAdditionalPropertiesOnly: Codable { +public struct ModelWithStringAdditionalPropertiesOnly: Codable { - public var additionalProperties: [String: String] = [:] + + + public var additionalProperties: [String:String] = [:] public subscript(key: String) -> String? { get { @@ -43,4 +45,5 @@ public struct ModelWithStringAdditionalPropertiesOnly: Codable { additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } + } diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift index db1a081b275d..6c50ccc4ca16 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift @@ -8,7 +8,8 @@ import Foundation /** This is a card object for a Person derived from BaseCard. */ -public struct PersonCard: Codable { +public struct PersonCard: Codable { + public var cardType: String public var firstName: String? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift index e11d38985a2e..8ff2db3bd880 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct PersonCardAllOf: Codable { + +public struct PersonCardAllOf: Codable { + public var firstName: String? public var lastName: String? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift index 0fd94cf83640..63abaeda4bd8 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift @@ -8,7 +8,8 @@ import Foundation /** This is a card object for a Person derived from BaseCard. */ -public struct PlaceCard: Codable { +public struct PlaceCard: Codable { + public var cardType: String public var placeName: String? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift index c5e89a15e00f..9f1da50fd576 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct PlaceCardAllOf: Codable { + +public struct PlaceCardAllOf: Codable { + public var placeName: String? public var placeAddress: String? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift index 7d884d88e185..9ef4613093d8 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift @@ -8,7 +8,8 @@ import Foundation /** This is a base class object from which other classes will derive. */ -public struct SampleBase: Codable { +public struct SampleBase: Codable { + public var baseClassStringProp: String? public var baseClassIntegerProp: Int? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift index c6ffc74a959d..1f8fe4e60982 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift @@ -8,7 +8,8 @@ import Foundation /** This is a subclass defived from the SampleBase class. */ -public struct SampleSubClass: Codable { +public struct SampleSubClass: Codable { + public var baseClassStringProp: String? public var baseClassIntegerProp: Int? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift index 7f52bb9fef4c..08ad426146a5 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift @@ -7,7 +7,9 @@ import Foundation -public struct SampleSubClassAllOf: Codable { + +public struct SampleSubClassAllOf: Codable { + public var subClassStringProp: String? public var subClassIntegerProp: Int? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift index 48273ea2c2ce..b8b82ebeb310 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum StringEnum: String, Codable, CaseIterable { case stringenumvalue1 = "stringEnumValue1" case stringenumvalue2 = "stringEnumValue2" diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift index 9b67f8a4af24..c445af38c130 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift @@ -8,7 +8,8 @@ import Foundation /** This object contains property names which we know will be different from their variable name. Examples of this include snake case property names and property names which are Swift 5 reserved words. */ -public struct VariableNameTest: Codable { +public struct VariableNameTest: Codable { + /** This snake-case examle_name property name should be converted to a camelCase variable name like exampleName */ public var exampleName: String? @@ -23,7 +24,7 @@ public struct VariableNameTest: Codable { self.normalName = normalName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case exampleName = "example_name" case _for = "for" case normalName diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift index 7cf1df17fb79..7d6c57044d81 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = TestClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ private class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/test/swift5/default/docs/SampleSubClass.md b/samples/client/test/swift5/default/docs/SampleSubClass.md index 435633ccde1c..d32058a5b2c4 100644 --- a/samples/client/test/swift5/default/docs/SampleSubClass.md +++ b/samples/client/test/swift5/default/docs/SampleSubClass.md @@ -3,8 +3,6 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**baseClassStringProp** | **String** | | [optional] -**baseClassIntegerProp** | **Int** | | [optional] **subClassStringProp** | **String** | | [optional] **subClassIntegerProp** | **Int** | | [optional] diff --git a/samples/config/petstore/apache2/.openapi-generator/VERSION b/samples/config/petstore/apache2/.openapi-generator/VERSION index 7fea99011a6f..bfbf77eb7fad 100644 --- a/samples/config/petstore/apache2/.openapi-generator/VERSION +++ b/samples/config/petstore/apache2/.openapi-generator/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/apache2/PetApi.conf b/samples/config/petstore/apache2/PetApi.conf index c92843e2610f..2d28dcdaa61b 100644 --- a/samples/config/petstore/apache2/PetApi.conf +++ b/samples/config/petstore/apache2/PetApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -16,7 +16,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -34,7 +34,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -48,7 +48,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -62,7 +62,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/apache2/StoreApi.conf b/samples/config/petstore/apache2/StoreApi.conf index f0fb742f55ac..b223a8816ba6 100644 --- a/samples/config/petstore/apache2/StoreApi.conf +++ b/samples/config/petstore/apache2/StoreApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -14,7 +14,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -24,7 +24,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/apache2/UserApi.conf b/samples/config/petstore/apache2/UserApi.conf index b01bb509728a..699b2b72c16c 100644 --- a/samples/config/petstore/apache2/UserApi.conf +++ b/samples/config/petstore/apache2/UserApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -11,7 +11,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -24,7 +24,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -37,7 +37,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -56,7 +56,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -69,7 +69,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/graphql-schema/.openapi-generator/VERSION b/samples/config/petstore/graphql-schema/.openapi-generator/VERSION index afa636560641..bfbf77eb7fad 100644 --- a/samples/config/petstore/graphql-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/graphql-schema/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql b/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql index 07bdf0c0adb4..865b0eb73190 100644 --- a/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql +++ b/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql b/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql index 30e2a034f20a..8c4137a4a4a4 100644 --- a/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql +++ b/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql b/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql index 12335c2207e5..e873f153b58d 100644 --- a/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql +++ b/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql b/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql index 2f8221d6f776..9db63eae5b9d 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/category.graphql b/samples/config/petstore/graphql-schema/petstore/model/category.graphql index eeeef5998ae4..b75961d86df7 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/category.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/category.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/order.graphql b/samples/config/petstore/graphql-schema/petstore/model/order.graphql index a76301107ac2..af6f699f8a95 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/order.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/order.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/pet.graphql b/samples/config/petstore/graphql-schema/petstore/model/pet.graphql index e8ce58e93da3..c346af193587 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/pet.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/pet.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/tag.graphql b/samples/config/petstore/graphql-schema/petstore/model/tag.graphql index 9fc620141a8c..a5002f44c9c1 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/tag.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/tag.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/user.graphql b/samples/config/petstore/graphql-schema/petstore/model/user.graphql index da66c49fb83e..2f678c28ea7b 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/user.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/user.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# OpenAPI spec version: 1.0.0 +# The version of the OpenAPI document: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION index c3a2c7076fa8..bfbf77eb7fad 100644 --- a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/asciidoc/.openapi-generator/VERSION b/samples/documentation/asciidoc/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/documentation/asciidoc/.openapi-generator/VERSION +++ b/samples/documentation/asciidoc/.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/documentation/cwiki/.openapi-generator/VERSION b/samples/documentation/cwiki/.openapi-generator/VERSION index d077ffb477a4..bfbf77eb7fad 100644 --- a/samples/documentation/cwiki/.openapi-generator/VERSION +++ b/samples/documentation/cwiki/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.4-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/cwiki/confluence-markup.txt b/samples/documentation/cwiki/confluence-markup.txt index f790908e8f14..4e13d4757fb8 100644 --- a/samples/documentation/cwiki/confluence-markup.txt +++ b/samples/documentation/cwiki/confluence-markup.txt @@ -1,128 +1,121 @@ -h1. OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +h1. OpenAPI Petstore + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. *Version:* 1.0.0 ---- +{expand:Table of Contents - Click to expand} {toc:printable=true|style=square|minLevel=2|maxLevel=3|type=list|outline=false|include=.*} +{expand} h2. Endpoints - h3. addPet - {status:colour=Yellow|title=post|subtle=false} - {code} - post /pet - {code} - *Summary:* Add a new pet to the store - *Description:* +h3. addPet +{panel:title=addPet|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Add a new pet to the store + *Description:* *No Description* - h4. Parameters + || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/pet{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + +---- +h4. Parameters - h5. Body Parameter +h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |pet |Pet object that needs to be added to the store |(/) | | | - - - + |body |Pet object that needs to be added to the store |(/) | | | +---- +h4. Responses - h4. Responses - *Status Code:* 405 - *Message:* Invalid input - {code:title=Response Type} + || Status Code | {status:colour=Green|title=405|subtle=false} | + || Message | Invalid input | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ + "description" : "Invalid input", + "content" : { } +}{code} | + - {code} - See [#models] +{panel} - {code:title=Response Schema |collapse=true} -{ - "description" : "Invalid input", - "content" : { } -} - {code} - ---- - - h3. deletePet - {status:colour=Yellow|title=delete|subtle=false} - {code} - delete /pet/{petId} - {code} +h3. deletePet +{panel:title=deletePet|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} *Summary:* Deletes a pet - *Description:* + *Description:* *No Description* - - h4. Parameters - h5. Path Parameters + || HttpMethod | {status:colour=Yellow|title=delete|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/pet/{petId}{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + +---- +h4. Parameters +h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |petId |Pet id to delete |(/) |null | | - h5. Header Parameters +h5. Header Parameters ||Name||Description||Required||Default||Pattern|| |apiKey | |(x) |null | | +---- +h4. Responses + || Status Code | {status:colour=Green|title=400|subtle=false} | + || Message | Invalid pet value | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ + "description" : "Invalid pet value", + "content" : { } +}{code} | + - - - h4. Responses - *Status Code:* 400 - *Message:* Invalid pet value - {code:title=Response Type} - - {code} - See [#models] +{panel} - {code:title=Response Schema |collapse=true} -{ - "description" : "Invalid pet value", - "content" : { } -} - {code} - ---- - - h3. findPetsByStatus - {status:colour=Yellow|title=get|subtle=false} - {code} - get /pet/findByStatus - {code} +h3. findPetsByStatus +{panel:title=findPetsByStatus|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} *Summary:* Finds Pets by status *Description:* Multiple status values can be provided with comma separated strings - - h4. Parameters + || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/pet/findByStatus{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | +---- +h4. Parameters - h5. Query Parameters +h5. Query Parameters ||Name||Description||Required||Default||Pattern|| |status |Status values that need to be considered for filter |(/) |null | | +---- +h4. Responses - - - - h4. Responses - *Status Code:* 200 - *Message:* successful operation - {code:title=Response Type} -array[Pet] - {code} - See [#models] - - - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=200|subtle=false} | + || Message | successful operation | + || Response Type | array[Pet] | + || Response Model | [array[Pet] Model|#array[Pet]ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "successful operation", "content" : { "application/xml" : { @@ -142,58 +135,51 @@ array[Pet] } } } -} - {code} - *Status Code:* 400 - *Message:* Invalid status value - {code:title=Response Type} +}{code} | + - {code} - See [#models] - - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=400|subtle=false} | + || Message | Invalid status value | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Invalid status value", "content" : { } -} - {code} - ---- - - h3. findPetsByTags - {status:colour=Yellow|title=get|subtle=false} - {code} - get /pet/findByTags - {code} - *Summary:* Finds Pets by tags - *Description:* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +}{code} | + +{panel} - h4. Parameters - - - - h5. Query Parameters - ||Name||Description||Required||Default||Pattern|| - |tags |Tags to filter by |(/) |null | | +h3. findPetsByTags +{panel:title=findPetsByTags|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Finds Pets by tags + *Description:* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/pet/findByTags{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | +---- +h4. Parameters - h4. Responses - *Status Code:* 200 - *Message:* successful operation - {code:title=Response Type} -array[Pet] - {code} - See [#models] +h5. Query Parameters + ||Name||Description||Required||Default||Pattern|| + |tags |Tags to filter by |(/) |null | | +---- +h4. Responses - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=200|subtle=false} | + || Message | successful operation | + || Response Type | array[Pet] | + || Response Model | [array[Pet] Model|#array[Pet]ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "successful operation", "content" : { "application/xml" : { @@ -213,58 +199,51 @@ array[Pet] } } } -} - {code} - *Status Code:* 400 - *Message:* Invalid tag value - {code:title=Response Type} - - {code} - See [#models] +}{code} | + - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=400|subtle=false} | + || Message | Invalid tag value | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Invalid tag value", "content" : { } -} - {code} - ---- - - h3. getPetById - {status:colour=Yellow|title=get|subtle=false} - {code} - get /pet/{petId} - {code} - *Summary:* Find pet by ID - *Description:* Returns a single pet - - - h4. Parameters - h5. Path Parameters - ||Name||Description||Required||Default||Pattern|| - |petId |ID of pet to return |(/) |null | | - +}{code} | + +{panel} +h3. getPetById +{panel:title=getPetById|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Find pet by ID + *Description:* Returns a single pet + || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/pet/{petId}{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | +---- +h4. Parameters +h5. Path Parameters + ||Name||Description||Required||Default||Pattern|| + |petId |ID of pet to return |(/) |null | | - h4. Responses - *Status Code:* 200 - *Message:* successful operation - {code:title=Response Type} -Pet - {code} - See [#models] +---- +h4. Responses - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=200|subtle=false} | + || Message | successful operation | + || Response Type | Pet | + || Response Model | [Pet Model|#PetModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "successful operation", "content" : { "application/xml" : { @@ -278,181 +257,156 @@ Pet } } } -} - {code} - *Status Code:* 400 - *Message:* Invalid ID supplied - {code:title=Response Type} - - {code} - See [#models] +}{code} | + - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=400|subtle=false} | + || Message | Invalid ID supplied | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Invalid ID supplied", "content" : { } -} - {code} - *Status Code:* 404 - *Message:* Pet not found - {code:title=Response Type} - - {code} - See [#models] +}{code} | + - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=404|subtle=false} | + || Message | Pet not found | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Pet not found", "content" : { } -} - {code} - ---- - - h3. updatePet - {status:colour=Yellow|title=put|subtle=false} - {code} - put /pet - {code} - *Summary:* Update an existing pet - *Description:* - - - h4. Parameters - - h5. Body Parameter - ||Name||Description||Required||Default||Pattern|| - |pet |Pet object that needs to be added to the store |(/) | | | - +}{code} | + +{panel} +h3. updatePet +{panel:title=updatePet|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Update an existing pet + *Description:* *No Description* + || HttpMethod | {status:colour=Yellow|title=put|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/pet{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + +---- +h4. Parameters - h4. Responses - *Status Code:* 400 - *Message:* Invalid ID supplied - {code:title=Response Type} +h5. Body Parameter + ||Name||Description||Required||Default||Pattern|| + |body |Pet object that needs to be added to the store |(/) | | | - {code} - See [#models] +---- +h4. Responses - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=400|subtle=false} | + || Message | Invalid ID supplied | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Invalid ID supplied", "content" : { } -} - {code} - *Status Code:* 404 - *Message:* Pet not found - {code:title=Response Type} - - {code} - See [#models] +}{code} | + - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=404|subtle=false} | + || Message | Pet not found | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Pet not found", "content" : { } -} - {code} - *Status Code:* 405 - *Message:* Validation exception - {code:title=Response Type} - - {code} - See [#models] +}{code} | + - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=405|subtle=false} | + || Message | Validation exception | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Validation exception", "content" : { } -} - {code} - ---- - - h3. updatePetWithForm - {status:colour=Yellow|title=post|subtle=false} - {code} - post /pet/{petId} - {code} - *Summary:* Updates a pet in the store with form data - *Description:* +}{code} | + +{panel} - h4. Parameters - h5. Path Parameters - ||Name||Description||Required||Default||Pattern|| - |petId |ID of pet that needs to be updated |(/) |null | | +h3. updatePetWithForm +{panel:title=updatePetWithForm|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Updates a pet in the store with form data + *Description:* *No Description* + || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/pet/{petId}{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + +---- +h4. Parameters +h5. Path Parameters + ||Name||Description||Required||Default||Pattern|| + |petId |ID of pet that needs to be updated |(/) |null | | +---- +h4. Responses - h4. Responses - *Status Code:* 405 - *Message:* Invalid input - {code:title=Response Type} + || Status Code | {status:colour=Green|title=405|subtle=false} | + || Message | Invalid input | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ + "description" : "Invalid input", + "content" : { } +}{code} | + - {code} - See [#models] +{panel} - {code:title=Response Schema |collapse=true} -{ - "description" : "Invalid input", - "content" : { } -} - {code} - ---- - - h3. uploadFile - {status:colour=Yellow|title=post|subtle=false} - {code} - post /pet/{petId}/uploadImage - {code} +h3. uploadFile +{panel:title=uploadFile|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} *Summary:* uploads an image - *Description:* - + *Description:* *No Description* - h4. Parameters - h5. Path Parameters + || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/pet/{petId}/uploadImage{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + || Produces | {noformat:nopanel=true}application/json{noformat} | +---- +h4. Parameters +h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |petId |ID of pet to update |(/) |null | | +---- +h4. Responses - - - - h4. Responses - *Status Code:* 200 - *Message:* successful operation - {code:title=Response Type} -ApiResponse - {code} - See [#models] - - - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=200|subtle=false} | + || Message | successful operation | + || Response Type | ApiResponse | + || Response Model | [ApiResponse Model|#ApiResponseModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "successful operation", "content" : { "application/json" : { @@ -461,93 +415,83 @@ ApiResponse } } } -} - {code} - ---- - - h3. deleteOrder - {status:colour=Yellow|title=delete|subtle=false} - {code} - delete /store/order/{orderId} - {code} - *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 - - - h4. Parameters - h5. Path Parameters - ||Name||Description||Required||Default||Pattern|| - |orderId |ID of the order that needs to be deleted |(/) |null | | - - +}{code} | + +{panel} +h3. deleteOrder +{panel:title=deleteOrder|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *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 + || HttpMethod | {status:colour=Yellow|title=delete|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/store/order/{orderId}{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + +---- +h4. Parameters +h5. Path Parameters + ||Name||Description||Required||Default||Pattern|| + |orderId |ID of the order that needs to be deleted |(/) |null | | - h4. Responses - *Status Code:* 400 - *Message:* Invalid ID supplied - {code:title=Response Type} - {code} - See [#models] +---- +h4. Responses - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=400|subtle=false} | + || Message | Invalid ID supplied | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Invalid ID supplied", "content" : { } -} - {code} - *Status Code:* 404 - *Message:* Order not found - {code:title=Response Type} - - {code} - See [#models] +}{code} | + - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=404|subtle=false} | + || Message | Order not found | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Order not found", "content" : { } -} - {code} - ---- - - h3. getInventory - {status:colour=Yellow|title=get|subtle=false} - {code} - get /store/inventory - {code} - *Summary:* Returns pet inventories by status - *Description:* Returns a map of status codes to quantities - - - h4. Parameters - +}{code} | + +{panel} +h3. getInventory +{panel:title=getInventory|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Returns pet inventories by status + *Description:* Returns a map of status codes to quantities + || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/store/inventory{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + || Produces | {noformat:nopanel=true}application/json{noformat} | +---- +h4. Parameters - h4. Responses - *Status Code:* 200 - *Message:* successful operation - {code:title=Response Type} -map[String, Integer] - {code} - See [#models] +---- +h4. Responses - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=200|subtle=false} | + || Message | successful operation | + || Response Type | map[String, Integer] | + || Response Model | [map[String, Integer] Model|#map[String, Integer]ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "successful operation", "content" : { "application/json" : { @@ -560,43 +504,40 @@ map[String, Integer] } } } -} - {code} - ---- - - h3. getOrderById - {status:colour=Yellow|title=get|subtle=false} - {code} - get /store/order/{orderId} - {code} - *Summary:* Find purchase order by ID - *Description:* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - - h4. Parameters - h5. Path Parameters - ||Name||Description||Required||Default||Pattern|| - |orderId |ID of pet that needs to be fetched |(/) |null | | - +}{code} | + +{panel} +h3. getOrderById +{panel:title=getOrderById|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Find purchase order by ID + *Description:* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/store/order/{orderId}{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | +---- +h4. Parameters +h5. Path Parameters + ||Name||Description||Required||Default||Pattern|| + |orderId |ID of pet that needs to be fetched |(/) |null | | - h4. Responses - *Status Code:* 200 - *Message:* successful operation - {code:title=Response Type} -Order - {code} - See [#models] +---- +h4. Responses - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=200|subtle=false} | + || Message | successful operation | + || Response Type | Order | + || Response Model | [Order Model|#OrderModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "successful operation", "content" : { "application/xml" : { @@ -610,73 +551,62 @@ Order } } } -} - {code} - *Status Code:* 400 - *Message:* Invalid ID supplied - {code:title=Response Type} - - {code} - See [#models] - +}{code} | + - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=400|subtle=false} | + || Message | Invalid ID supplied | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Invalid ID supplied", "content" : { } -} - {code} - *Status Code:* 404 - *Message:* Order not found - {code:title=Response Type} +}{code} | + - {code} - See [#models] - - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=404|subtle=false} | + || Message | Order not found | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Order not found", "content" : { } -} - {code} - ---- - - h3. placeOrder - {status:colour=Yellow|title=post|subtle=false} - {code} - post /store/order - {code} - *Summary:* Place an order for a pet - *Description:* - - - h4. Parameters - - h5. Body Parameter - ||Name||Description||Required||Default||Pattern|| - |order |order placed for purchasing the pet |(/) | | | +}{code} | + +{panel} +h3. placeOrder +{panel:title=placeOrder|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Place an order for a pet + *Description:* *No Description* + || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/store/order{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | +---- +h4. Parameters +h5. Body Parameter + ||Name||Description||Required||Default||Pattern|| + |body |order placed for purchasing the pet |(/) | | | - h4. Responses - *Status Code:* 200 - *Message:* successful operation - {code:title=Response Type} -Order - {code} - See [#models] +---- +h4. Responses - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=200|subtle=false} | + || Message | successful operation | + || Response Type | Order | + || Response Model | [Order Model|#OrderModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "successful operation", "content" : { "application/xml" : { @@ -690,229 +620,206 @@ Order } } } -} - {code} - *Status Code:* 400 - *Message:* Invalid Order - {code:title=Response Type} - - {code} - See [#models] +}{code} | + - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=400|subtle=false} | + || Message | Invalid Order | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Invalid Order", "content" : { } -} - {code} - ---- - - h3. createUser - {status:colour=Yellow|title=post|subtle=false} - {code} - post /user - {code} - *Summary:* Create user - *Description:* This can only be done by the logged in user. - - - h4. Parameters - - h5. Body Parameter - ||Name||Description||Required||Default||Pattern|| - |user |Created user object |(/) | | | - +}{code} | + +{panel} +h3. createUser +{panel:title=createUser|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Create user + *Description:* This can only be done by the logged in user. + || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/user{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + +---- +h4. Parameters - h4. Responses - *Status Code:* 0 - *Message:* successful operation - {code:title=Response Type} +h5. Body Parameter + ||Name||Description||Required||Default||Pattern|| + |body |Created user object |(/) | | | - {code} - See [#models] +---- +h4. Responses - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=0|subtle=false} | + || Message | successful operation | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "successful operation", "content" : { } -} - {code} - ---- - - h3. createUsersWithArrayInput - {status:colour=Yellow|title=post|subtle=false} - {code} - post /user/createWithArray - {code} - *Summary:* Creates list of users with given input array - *Description:* - - - h4. Parameters - - h5. Body Parameter - ||Name||Description||Required||Default||Pattern|| - |user |List of user object |(/) | | | - +}{code} | + +{panel} +h3. createUsersWithArrayInput +{panel:title=createUsersWithArrayInput|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Creates list of users with given input array + *Description:* *No Description* + || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/user/createWithArray{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + +---- +h4. Parameters - h4. Responses - *Status Code:* 0 - *Message:* successful operation - {code:title=Response Type} +h5. Body Parameter + ||Name||Description||Required||Default||Pattern|| + |body |List of user object |(/) | | | - {code} - See [#models] +---- +h4. Responses - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=0|subtle=false} | + || Message | successful operation | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "successful operation", "content" : { } -} - {code} - ---- - - h3. createUsersWithListInput - {status:colour=Yellow|title=post|subtle=false} - {code} - post /user/createWithList - {code} - *Summary:* Creates list of users with given input array - *Description:* +}{code} | + +{panel} - h4. Parameters - h5. Body Parameter - ||Name||Description||Required||Default||Pattern|| - |user |List of user object |(/) | | | +h3. createUsersWithListInput +{panel:title=createUsersWithListInput|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Creates list of users with given input array + *Description:* *No Description* + || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/user/createWithList{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + +---- +h4. Parameters +h5. Body Parameter + ||Name||Description||Required||Default||Pattern|| + |body |List of user object |(/) | | | +---- +h4. Responses - h4. Responses - *Status Code:* 0 - *Message:* successful operation - {code:title=Response Type} + || Status Code | {status:colour=Green|title=0|subtle=false} | + || Message | successful operation | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ + "description" : "successful operation", + "content" : { } +}{code} | + - {code} - See [#models] +{panel} - {code:title=Response Schema |collapse=true} -{ - "description" : "successful operation", - "content" : { } -} - {code} - ---- - - h3. deleteUser - {status:colour=Yellow|title=delete|subtle=false} - {code} - delete /user/{username} - {code} +h3. deleteUser +{panel:title=deleteUser|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} *Summary:* Delete user *Description:* This can only be done by the logged in user. - - h4. Parameters - h5. Path Parameters + || HttpMethod | {status:colour=Yellow|title=delete|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/user/{username}{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + +---- +h4. Parameters +h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |username |The name that needs to be deleted |(/) |null | | +---- +h4. Responses - - - - h4. Responses - *Status Code:* 400 - *Message:* Invalid username supplied - {code:title=Response Type} - - {code} - See [#models] - - - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=400|subtle=false} | + || Message | Invalid username supplied | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Invalid username supplied", "content" : { } -} - {code} - *Status Code:* 404 - *Message:* User not found - {code:title=Response Type} - - {code} - See [#models] +}{code} | + - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=404|subtle=false} | + || Message | User not found | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "User not found", "content" : { } -} - {code} - ---- - - h3. getUserByName - {status:colour=Yellow|title=get|subtle=false} - {code} - get /user/{username} - {code} - *Summary:* Get user by user name - *Description:* - - - h4. Parameters - h5. Path Parameters - ||Name||Description||Required||Default||Pattern|| - |username |The name that needs to be fetched. Use user1 for testing. |(/) |null | | - +}{code} | + +{panel} +h3. getUserByName +{panel:title=getUserByName|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Get user by user name + *Description:* *No Description* + || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/user/{username}{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | +---- +h4. Parameters +h5. Path Parameters + ||Name||Description||Required||Default||Pattern|| + |username |The name that needs to be fetched. Use user1 for testing. |(/) |null | | - h4. Responses - *Status Code:* 200 - *Message:* successful operation - {code:title=Response Type} -User - {code} - See [#models] +---- +h4. Responses - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=200|subtle=false} | + || Message | successful operation | + || Response Type | User | + || Response Model | [User Model|#UserModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "successful operation", "content" : { "application/xml" : { @@ -926,75 +833,63 @@ User } } } -} - {code} - *Status Code:* 400 - *Message:* Invalid username supplied - {code:title=Response Type} +}{code} | + - {code} - See [#models] + || Status Code | {status:colour=Green|title=400|subtle=false} | + || Message | Invalid username supplied | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ + "description" : "Invalid username supplied", + "content" : { } +}{code} | + - {code:title=Response Schema |collapse=true} -{ - "description" : "Invalid username supplied", + || Status Code | {status:colour=Green|title=404|subtle=false} | + || Message | User not found | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ + "description" : "User not found", "content" : { } -} - {code} - *Status Code:* 404 - *Message:* User not found - {code:title=Response Type} +}{code} | + - {code} - See [#models] +{panel} - {code:title=Response Schema |collapse=true} -{ - "description" : "User not found", - "content" : { } -} - {code} - ---- - - h3. loginUser - {status:colour=Yellow|title=get|subtle=false} - {code} - get /user/login - {code} +h3. loginUser +{panel:title=loginUser|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} *Summary:* Logs user into the system - *Description:* + *Description:* *No Description* - - h4. Parameters + || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/user/login{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | +---- +h4. Parameters - h5. Query Parameters +h5. Query Parameters ||Name||Description||Required||Default||Pattern|| |username |The user name for login |(/) |null | | - |password |The password for login in clear text |(/) |null | | +---- +h4. Responses - - - - h4. Responses - *Status Code:* 200 - *Message:* successful operation - {code:title=Response Type} -String - {code} - See [#models] - - - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=200|subtle=false} | + || Message | successful operation | + || Response Type | String | + || Response Model | [String Model|#StringModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "successful operation", "headers" : { "X-Rate-Limit" : { @@ -1024,156 +919,151 @@ String } } } -} - {code} - *Status Code:* 400 - *Message:* Invalid username/password supplied - {code:title=Response Type} - - {code} - See [#models] +}{code} | + - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=400|subtle=false} | + || Message | Invalid username/password supplied | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Invalid username/password supplied", "content" : { } -} - {code} - ---- - - h3. logoutUser - {status:colour=Yellow|title=get|subtle=false} - {code} - get /user/logout - {code} - *Summary:* Logs out current logged in user session - *Description:* +}{code} | + +{panel} - h4. Parameters +h3. logoutUser +{panel:title=logoutUser|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + *Summary:* Logs out current logged in user session + *Description:* *No Description* + || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/user/logout{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + +---- +h4. Parameters +---- +h4. Responses - h4. Responses - *Status Code:* 0 - *Message:* successful operation - {code:title=Response Type} + || Status Code | {status:colour=Green|title=0|subtle=false} | + || Message | successful operation | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ + "description" : "successful operation", + "content" : { } +}{code} | + - {code} - See [#models] +{panel} - {code:title=Response Schema |collapse=true} -{ - "description" : "successful operation", - "content" : { } -} - {code} - ---- - - h3. updateUser - {status:colour=Yellow|title=put|subtle=false} - {code} - put /user/{username} - {code} +h3. updateUser +{panel:title=updateUser|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} *Summary:* Updated user *Description:* This can only be done by the logged in user. - - h4. Parameters - h5. Path Parameters + || HttpMethod | {status:colour=Yellow|title=put|subtle=false} | + || Protocol | {noformat:nopanel=true}http{noformat} | + || Path | {noformat:nopanel=true}/user/{username}{noformat} | + || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | + +---- +h4. Parameters +h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |username |name that need to be deleted |(/) |null | | - h5. Body Parameter +h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |user |Updated user object |(/) | | | - - - - - + |body |Updated user object |(/) | | | - h4. Responses - *Status Code:* 400 - *Message:* Invalid user supplied - {code:title=Response Type} - - {code} - See [#models] - +---- +h4. Responses - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=400|subtle=false} | + || Message | Invalid user supplied | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "Invalid user supplied", "content" : { } -} - {code} - *Status Code:* 404 - *Message:* User not found - {code:title=Response Type} - - {code} - See [#models] +}{code} | + - - {code:title=Response Schema |collapse=true} -{ + || Status Code | {status:colour=Green|title=404|subtle=false} | + || Message | User not found | + || Response Type | | + || Response Model | [ Model|#ModelAnchor|Jump to model] | + || Response Schema | {code:collapse=true}{ "description" : "User not found", "content" : { } -} - {code} - ---- +}{code} | + + +{panel} + +{anchor:models} h2. Models + {anchor:ApiResponseModelAnchor} h3. ApiResponse ||Field Name||Required||Type||Description|| - |code | |Integer | | - |type | |String | | - |message | |String | | + |code |(x) |{noformat:nopanel=true}Integer{noformat} | | + |type |(x) |{noformat:nopanel=true}String{noformat} | | + |message |(x) |{noformat:nopanel=true}String{noformat} | | + {anchor:CategoryModelAnchor} h3. Category ||Field Name||Required||Type||Description|| - |id | |Long | | - |name | |String | | + |id |(x) |{noformat:nopanel=true}Long{noformat} | | + |name |(x) |{noformat:nopanel=true}String{noformat} | | + {anchor:OrderModelAnchor} h3. Order ||Field Name||Required||Type||Description|| - |id | |Long | | - |petId | |Long | | - |quantity | |Integer | | - |shipDate | |Date | | - |status | |String |Order Status | - |complete | |Boolean | | + |id |(x) |{noformat:nopanel=true}Long{noformat} | | + |petId |(x) |{noformat:nopanel=true}Long{noformat} | | + |quantity |(x) |{noformat:nopanel=true}Integer{noformat} | | + |shipDate |(x) |{noformat:nopanel=true}Date{noformat} | | + |status |(x) |{noformat:nopanel=true}String{noformat} |Order Status | + |complete |(x) |{noformat:nopanel=true}Boolean{noformat} | | + {anchor:PetModelAnchor} h3. Pet ||Field Name||Required||Type||Description|| - |id | |Long | | - |category | |Category | | - |name | |String | | - |photoUrls | |array[String] | | - |tags | |array[Tag] | | - |status | |String |pet status in the store | + |id |(x) |{noformat:nopanel=true}Long{noformat} | | + |category |(x) |{noformat:nopanel=true}Category{noformat} | | + |name |(/) |{noformat:nopanel=true}String{noformat} | | + |photoUrls |(/) |{noformat:nopanel=true}array[String]{noformat} | | + |tags |(x) |{noformat:nopanel=true}array[Tag]{noformat} | | + |status |(x) |{noformat:nopanel=true}String{noformat} |pet status in the store | + {anchor:TagModelAnchor} h3. Tag ||Field Name||Required||Type||Description|| - |id | |Long | | - |name | |String | | + |id |(x) |{noformat:nopanel=true}Long{noformat} | | + |name |(x) |{noformat:nopanel=true}String{noformat} | | + {anchor:UserModelAnchor} h3. User ||Field Name||Required||Type||Description|| - |id | |Long | | - |username | |String | | - |firstName | |String | | - |lastName | |String | | - |email | |String | | - |password | |String | | - |phone | |String | | - |userStatus | |Integer |User Status | + |id |(x) |{noformat:nopanel=true}Long{noformat} | | + |username |(x) |{noformat:nopanel=true}String{noformat} | | + |firstName |(x) |{noformat:nopanel=true}String{noformat} | | + |lastName |(x) |{noformat:nopanel=true}String{noformat} | | + |email |(x) |{noformat:nopanel=true}String{noformat} | | + |password |(x) |{noformat:nopanel=true}String{noformat} | | + |phone |(x) |{noformat:nopanel=true}String{noformat} | | + |userStatus |(x) |{noformat:nopanel=true}Integer{noformat} |User Status | diff --git a/samples/documentation/dynamic-html/.openapi-generator/VERSION b/samples/documentation/dynamic-html/.openapi-generator/VERSION index 14900cee60e8..bfbf77eb7fad 100644 --- a/samples/documentation/dynamic-html/.openapi-generator/VERSION +++ b/samples/documentation/dynamic-html/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/dynamic-html/docs/operations/PetApi.html b/samples/documentation/dynamic-html/docs/operations/PetApi.html index 75a5fda414f8..3253976d7385 100644 --- a/samples/documentation/dynamic-html/docs/operations/PetApi.html +++ b/samples/documentation/dynamic-html/docs/operations/PetApi.html @@ -20,7 +20,7 @@

Parameters

Body: - Pet + body Pet(Pet)

Pet object that needs to be added to the store

@@ -151,7 +151,7 @@

Parameters

Body: - Pet + body Pet(Pet)

Pet object that needs to be added to the store

diff --git a/samples/documentation/dynamic-html/docs/operations/StoreApi.html b/samples/documentation/dynamic-html/docs/operations/StoreApi.html index cb880712d31a..f0bbff63e859 100644 --- a/samples/documentation/dynamic-html/docs/operations/StoreApi.html +++ b/samples/documentation/dynamic-html/docs/operations/StoreApi.html @@ -81,7 +81,7 @@

Parameters

Body: - Order + body Order(Order)

order placed for purchasing the pet

diff --git a/samples/documentation/dynamic-html/docs/operations/UserApi.html b/samples/documentation/dynamic-html/docs/operations/UserApi.html index f3940e0f4bde..ecc44e43656a 100644 --- a/samples/documentation/dynamic-html/docs/operations/UserApi.html +++ b/samples/documentation/dynamic-html/docs/operations/UserApi.html @@ -20,7 +20,7 @@

Parameters

Body: - User + body User(User)

Created user object

@@ -44,8 +44,8 @@

Parameters

Body: - User - List(array) + body + List(User)

List of user object

@@ -68,8 +68,8 @@

Parameters

Body: - User - List(array) + body + List(User)

List of user object

@@ -199,7 +199,7 @@

Parameters

Body: - User + body User(User)

Updated user object

diff --git a/samples/documentation/html.md/.openapi-generator/VERSION b/samples/documentation/html.md/.openapi-generator/VERSION index 096bf47efe31..bfbf77eb7fad 100644 --- a/samples/documentation/html.md/.openapi-generator/VERSION +++ b/samples/documentation/html.md/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html.md/index.html b/samples/documentation/html.md/index.html index 7545df2e3190..63ef7f704b0c 100644 --- a/samples/documentation/html.md/index.html +++ b/samples/documentation/html.md/index.html @@ -189,8 +189,8 @@

An API with more Markdown in summary, description,
  • in schema (model) member descriptions
  • -
    More information: https://helloreverb.com
    -
    Contact Info: hello@helloreverb.com
    + +
    Contact Info: team@openapitools.org
    Version: 0.1.0
    BasePath:/v1
    All rights reserved
    @@ -226,7 +226,7 @@

    Query parameters

    seed (required)
    -
    Query Parameter — A random number seed.
    +
    Query Parameter — A random number seed. default: null
    @@ -242,8 +242,8 @@

    Example data

    Content-Type: */*
    {
       "sequence" : 1,
    -  "seed" : 6.02745618307040320615897144307382404804229736328125,
    -  "value" : 0.80082819046101150206595775671303272247314453125
    +  "seed" : 6.027456183070403,
    +  "value" : 0.8008281904610115
     }

    Produces

    diff --git a/samples/documentation/html/.openapi-generator/VERSION b/samples/documentation/html/.openapi-generator/VERSION index d077ffb477a4..bfbf77eb7fad 100644 --- a/samples/documentation/html/.openapi-generator/VERSION +++ b/samples/documentation/html/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.4-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html/index.html b/samples/documentation/html/index.html index 387ee5572165..0c50abd609f7 100644 --- a/samples/documentation/html/index.html +++ b/samples/documentation/html/index.html @@ -246,7 +246,7 @@

    Consumes

    Request body

    -
    Pet Pet (required)
    +
    body Pet (required)
    Body Parameter
    @@ -551,7 +551,7 @@

    Consumes

    Request body

    -
    Pet Pet (required)
    +
    body Pet (required)
    Body Parameter
    @@ -829,7 +829,7 @@

    404

    Request body

    -
    Order Order (required)
    +
    body Order (required)
    Body Parameter
    @@ -896,7 +896,7 @@

    User

    Request body

    -
    User User (required)
    +
    body User (required)
    Body Parameter
    @@ -927,7 +927,7 @@

    default

    Request body

    -
    User array (required)
    +
    body User (required)
    Body Parameter
    @@ -958,7 +958,7 @@

    default

    Request body

    -
    User array (required)
    +
    body User (required)
    Body Parameter
    @@ -1171,7 +1171,7 @@

    Path parameters

    Request body

    -
    User User (required)
    +
    body User (required)
    Body Parameter
    diff --git a/samples/documentation/html2/.openapi-generator/VERSION b/samples/documentation/html2/.openapi-generator/VERSION index 14900cee60e8..bfbf77eb7fad 100644 --- a/samples/documentation/html2/.openapi-generator/VERSION +++ b/samples/documentation/html2/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html2/index.html b/samples/documentation/html2/index.html index 2b37cc2b4bb3..ea3898370661 100644 --- a/samples/documentation/html2/index.html +++ b/samples/documentation/html2/index.html @@ -1144,15 +1144,16 @@

    Usage and SDK Samples

    petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet body = ; // Pet | try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); } } -} +} +
    @@ -1162,9 +1163,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet body = ; // Pet | try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -1182,12 +1183,12 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Pet *pet = ; // +Pet *body = ; // PetApi *apiInstance = [[PetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWith:pet +[apiInstance addPetWith:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); @@ -1205,7 +1206,7 @@

    Usage and SDK Samples

    petstore_auth.accessToken = "YOUR ACCESS TOKEN" var api = new OpenApiPetstore.PetApi() -var pet = ; // {Pet} +var body = ; // {Pet} var callback = function(error, data, response) { if (error) { @@ -1214,7 +1215,7 @@

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.addPet(pet, callback); +api.addPet(body, callback);
    @@ -1239,12 +1240,12 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | + var body = new Pet(); // Pet | try { // Add a new pet to the store - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (Exception e) { @@ -1264,10 +1265,10 @@

    Usage and SDK Samples

    OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new OpenAPITools\Client\Api\PetApi(); -$pet = ; // Pet | +$body = ; // Pet | try { - $api_instance->addPet($pet); + $api_instance->addPet($body); } catch (Exception $e) { echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL; } @@ -1283,10 +1284,10 @@

    Usage and SDK Samples

    $WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::OPenAPIClient::PetApi->new(); -my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | +my $body = WWW::OPenAPIClient::Object::Pet->new(); # Pet | eval { - $api_instance->addPet(pet => $pet); + $api_instance->addPet(body => $body); }; if ($@) { warn "Exception when calling PetApi->addPet: $@\n"; @@ -1305,11 +1306,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -pet = # Pet | +body = # Pet | try: # Add a new pet to the store - api_instance.add_pet(pet) + api_instance.add_pet(body) except ApiException as e: print("Exception when calling PetApi->addPet: %s\n" % e)
    @@ -1318,10 +1319,10 @@

    Usage and SDK Samples

    extern crate PetApi;
     
     pub fn main() {
    -    let pet = ; // Pet
    +    let body = ; // Pet
     
         let mut context = PetApi::Context::default();
    -    let result = client.addPet(pet, &context).wait();
    +    let result = client.addPet(body, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -1354,7 +1355,7 @@ 

    Parameters

    Name Description - pet * + body *

    Pet object that needs to be added to the store

    -
    +
    @@ -1473,7 +1474,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -}
    +} +
    @@ -1504,8 +1506,8 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // Pet id to delete -String *apiKey = apiKey_example; // (optional) +Long *petId = 789; // Pet id to delete (default to null) +String *apiKey = apiKey_example; // (optional) (default to null) PetApi *apiInstance = [[PetApi alloc] init]; @@ -1566,8 +1568,8 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | Pet id to delete - var apiKey = apiKey_example; // String | (optional) + var petId = 789; // Long | Pet id to delete (default to null) + var apiKey = apiKey_example; // String | (optional) (default to null) try { @@ -1635,8 +1637,8 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | Pet id to delete -apiKey = apiKey_example # String | (optional) +petId = 789 # Long | Pet id to delete (default to null) +apiKey = apiKey_example # String | (optional) (default to null) try: # Deletes a pet @@ -1829,7 +1831,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} +} +
    @@ -1860,7 +1863,7 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -array[String] *status = ; // Status values that need to be considered for filter +array[String] *status = ; // Status values that need to be considered for filter (default to null) PetApi *apiInstance = [[PetApi alloc] init]; @@ -1920,7 +1923,7 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var status = new array[String](); // array[String] | Status values that need to be considered for filter + var status = new array[String](); // array[String] | Status values that need to be considered for filter (default to null) try { @@ -1989,7 +1992,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -status = # array[String] | Status values that need to be considered for filter +status = # array[String] | Status values that need to be considered for filter (default to null) try: # Finds Pets by status @@ -2227,7 +2230,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} +} +
    @@ -2258,7 +2262,7 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -array[String] *tags = ; // Tags to filter by +array[String] *tags = ; // Tags to filter by (default to null) PetApi *apiInstance = [[PetApi alloc] init]; @@ -2318,7 +2322,7 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var tags = new array[String](); // array[String] | Tags to filter by + var tags = new array[String](); // array[String] | Tags to filter by (default to null) try { @@ -2387,7 +2391,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -tags = # array[String] | Tags to filter by +tags = # array[String] | Tags to filter by (default to null) try: # Finds Pets by tags @@ -2627,7 +2631,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} +} +
    @@ -2660,7 +2665,7 @@

    Usage and SDK Samples

    // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; -Long *petId = 789; // ID of pet to return +Long *petId = 789; // ID of pet to return (default to null) PetApi *apiInstance = [[PetApi alloc] init]; @@ -2724,7 +2729,7 @@

    Usage and SDK Samples

    // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer"); var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet to return + var petId = 789; // Long | ID of pet to return (default to null) try { @@ -2799,7 +2804,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet to return +petId = 789 # Long | ID of pet to return (default to null) try: # Find pet by ID @@ -3037,15 +3042,16 @@

    Usage and SDK Samples

    petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet body = ; // Pet | try { - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); } } -} +} +
    @@ -3055,9 +3061,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet body = ; // Pet | try { - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -3075,12 +3081,12 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Pet *pet = ; // +Pet *body = ; // PetApi *apiInstance = [[PetApi alloc] init]; // Update an existing pet -[apiInstance updatePetWith:pet +[apiInstance updatePetWith:body completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); @@ -3098,7 +3104,7 @@

    Usage and SDK Samples

    petstore_auth.accessToken = "YOUR ACCESS TOKEN" var api = new OpenApiPetstore.PetApi() -var pet = ; // {Pet} +var body = ; // {Pet} var callback = function(error, data, response) { if (error) { @@ -3107,7 +3113,7 @@

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.updatePet(pet, callback); +api.updatePet(body, callback);
    @@ -3132,12 +3138,12 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | + var body = new Pet(); // Pet | try { // Update an existing pet - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (Exception e) { @@ -3157,10 +3163,10 @@

    Usage and SDK Samples

    OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new OpenAPITools\Client\Api\PetApi(); -$pet = ; // Pet | +$body = ; // Pet | try { - $api_instance->updatePet($pet); + $api_instance->updatePet($body); } catch (Exception $e) { echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL; } @@ -3176,10 +3182,10 @@

    Usage and SDK Samples

    $WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::OPenAPIClient::PetApi->new(); -my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | +my $body = WWW::OPenAPIClient::Object::Pet->new(); # Pet | eval { - $api_instance->updatePet(pet => $pet); + $api_instance->updatePet(body => $body); }; if ($@) { warn "Exception when calling PetApi->updatePet: $@\n"; @@ -3198,11 +3204,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -pet = # Pet | +body = # Pet | try: # Update an existing pet - api_instance.update_pet(pet) + api_instance.update_pet(body) except ApiException as e: print("Exception when calling PetApi->updatePet: %s\n" % e)
    @@ -3211,10 +3217,10 @@

    Usage and SDK Samples

    extern crate PetApi;
     
     pub fn main() {
    -    let pet = ; // Pet
    +    let body = ; // Pet
     
         let mut context = PetApi::Context::default();
    -    let result = client.updatePet(pet, &context).wait();
    +    let result = client.updatePet(body, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -3247,7 +3253,7 @@ 

    Parameters

    Name Description - pet * + body *

    Pet object that needs to be added to the store

    -
    +
    @@ -3411,7 +3417,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -}
    +} +
    @@ -3443,7 +3450,7 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // ID of pet that needs to be updated +Long *petId = 789; // ID of pet that needs to be updated (default to null) String *name = name_example; // Updated name of the pet (optional) (default to null) String *status = status_example; // Updated status of the pet (optional) (default to null) @@ -3508,7 +3515,7 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet that needs to be updated + var petId = 789; // Long | ID of pet that needs to be updated (default to null) var name = name_example; // String | Updated name of the pet (optional) (default to null) var status = status_example; // String | Updated status of the pet (optional) (default to null) @@ -3580,7 +3587,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet that needs to be updated +petId = 789 # Long | ID of pet that needs to be updated (default to null) name = name_example # String | Updated name of the pet (optional) (default to null) status = status_example # String | Updated status of the pet (optional) (default to null) @@ -3801,7 +3808,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} +} +
    @@ -3834,7 +3842,7 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // ID of pet to update +Long *petId = 789; // ID of pet to update (default to null) String *additionalMetadata = additionalMetadata_example; // Additional data to pass to server (optional) (default to null) File *file = BINARY_DATA_HERE; // file to upload (optional) (default to null) @@ -3902,7 +3910,7 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet to update + var petId = 789; // Long | ID of pet to update (default to null) var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server (optional) (default to null) var file = BINARY_DATA_HERE; // File | file to upload (optional) (default to null) @@ -3977,7 +3985,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet to update +petId = 789 # Long | ID of pet to update (default to null) additionalMetadata = additionalMetadata_example # String | Additional data to pass to server (optional) (default to null) file = BINARY_DATA_HERE # File | file to upload (optional) (default to null) @@ -4236,7 +4244,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} +} +
    @@ -4261,7 +4270,7 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *orderId = orderId_example; // ID of the order that needs to be deleted
    +                              
    String *orderId = orderId_example; // ID of the order that needs to be deleted (default to null)
     
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
    @@ -4310,7 +4319,7 @@ 

    Usage and SDK Samples

    { var apiInstance = new StoreApi(); - var orderId = orderId_example; // String | ID of the order that needs to be deleted + var orderId = orderId_example; // String | ID of the order that needs to be deleted (default to null) try { @@ -4367,7 +4376,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.StoreApi() -orderId = orderId_example # String | ID of the order that needs to be deleted +orderId = orderId_example # String | ID of the order that needs to be deleted (default to null) try: # Delete purchase order by ID @@ -4545,7 +4554,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -}
    +} +
    @@ -4872,7 +4882,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} +} +
    @@ -4898,7 +4909,7 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    Long *orderId = 789; // ID of pet that needs to be fetched
    +                              
    Long *orderId = 789; // ID of pet that needs to be fetched (default to null)
     
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
    @@ -4950,7 +4961,7 @@ 

    Usage and SDK Samples

    { var apiInstance = new StoreApi(); - var orderId = 789; // Long | ID of pet that needs to be fetched + var orderId = 789; // Long | ID of pet that needs to be fetched (default to null) try { @@ -5010,7 +5021,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.StoreApi() -orderId = 789 # Long | ID of pet that needs to be fetched +orderId = 789 # Long | ID of pet that needs to be fetched (default to null) try: # Find purchase order by ID @@ -5243,16 +5254,17 @@

    Usage and SDK Samples

    public static void main(String[] args) { StoreApi apiInstance = new StoreApi(); - Order order = ; // Order | + Order body = ; // Order | try { - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); e.printStackTrace(); } } -}
    +} +
    @@ -5262,9 +5274,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { StoreApi apiInstance = new StoreApi(); - Order order = ; // Order | + Order body = ; // Order | try { - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -5278,12 +5290,12 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    Order *order = ; // 
    +                              
    Order *body = ; // 
     
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
     // Place an order for a pet
    -[apiInstance placeOrderWith:order
    +[apiInstance placeOrderWith:body
                   completionHandler: ^(Order output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
    @@ -5299,7 +5311,7 @@ 

    Usage and SDK Samples

    var OpenApiPetstore = require('open_api_petstore');
     
     var api = new OpenApiPetstore.StoreApi()
    -var order = ; // {Order} 
    +var body = ; // {Order} 
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -5308,7 +5320,7 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.placeOrder(order, callback); +api.placeOrder(body, callback);
    @@ -5330,12 +5342,12 @@

    Usage and SDK Samples

    { var apiInstance = new StoreApi(); - var order = new Order(); // Order | + var body = new Order(); // Order | try { // Place an order for a pet - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); Debug.WriteLine(result); } catch (Exception e) @@ -5353,10 +5365,10 @@

    Usage and SDK Samples

    require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\StoreApi(); -$order = ; // Order | +$body = ; // Order | try { - $result = $api_instance->placeOrder($order); + $result = $api_instance->placeOrder($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL; @@ -5370,10 +5382,10 @@

    Usage and SDK Samples

    use WWW::OPenAPIClient::StoreApi; my $api_instance = WWW::OPenAPIClient::StoreApi->new(); -my $order = WWW::OPenAPIClient::Object::Order->new(); # Order | +my $body = WWW::OPenAPIClient::Object::Order->new(); # Order | eval { - my $result = $api_instance->placeOrder(order => $order); + my $result = $api_instance->placeOrder(body => $body); print Dumper($result); }; if ($@) { @@ -5390,11 +5402,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.StoreApi() -order = # Order | +body = # Order | try: # Place an order for a pet - api_response = api_instance.place_order(order) + api_response = api_instance.place_order(body) pprint(api_response) except ApiException as e: print("Exception when calling StoreApi->placeOrder: %s\n" % e)
    @@ -5404,10 +5416,10 @@

    Usage and SDK Samples

    extern crate StoreApi;
     
     pub fn main() {
    -    let order = ; // Order
    +    let body = ; // Order
     
         let mut context = StoreApi::Context::default();
    -    let result = client.placeOrder(order, &context).wait();
    +    let result = client.placeOrder(body, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -5430,7 +5442,7 @@ 

    Parameters

    Name Description - order * + body *

    order placed for purchasing the pet

    -
    +
    @@ -5604,15 +5616,16 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - User user = ; // User | + User body = ; // User | try { - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); } } -}
    +} +
    @@ -5622,9 +5635,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - User user = ; // User | + User body = ; // User | try { - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -5637,12 +5650,12 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    User *user = ; // 
    +                              
    User *body = ; // 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Create user
    -[apiInstance createUserWith:user
    +[apiInstance createUserWith:body
                   completionHandler: ^(NSError* error) {
                                 if (error) {
                                     NSLog(@"Error: %@", error);
    @@ -5655,7 +5668,7 @@ 

    Usage and SDK Samples

    var OpenApiPetstore = require('open_api_petstore');
     
     var api = new OpenApiPetstore.UserApi()
    -var user = ; // {User} 
    +var body = ; // {User} 
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -5664,7 +5677,7 @@ 

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.createUser(user, callback); +api.createUser(body, callback);
    @@ -5686,12 +5699,12 @@

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var user = new User(); // User | + var body = new User(); // User | try { // Create user - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (Exception e) { @@ -5708,10 +5721,10 @@

    Usage and SDK Samples

    require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$user = ; // User | +$body = ; // User | try { - $api_instance->createUser($user); + $api_instance->createUser($body); } catch (Exception $e) { echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL; } @@ -5724,10 +5737,10 @@

    Usage and SDK Samples

    use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $user = WWW::OPenAPIClient::Object::User->new(); # User | +my $body = WWW::OPenAPIClient::Object::User->new(); # User | eval { - $api_instance->createUser(user => $user); + $api_instance->createUser(body => $body); }; if ($@) { warn "Exception when calling UserApi->createUser: $@\n"; @@ -5743,11 +5756,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -user = # User | +body = # User | try: # Create user - api_instance.create_user(user) + api_instance.create_user(body) except ApiException as e: print("Exception when calling UserApi->createUser: %s\n" % e)
    @@ -5756,10 +5769,10 @@

    Usage and SDK Samples

    extern crate UserApi;
     
     pub fn main() {
    -    let user = ; // User
    +    let body = ; // User
     
         let mut context = UserApi::Context::default();
    -    let result = client.createUser(user, &context).wait();
    +    let result = client.createUser(body, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -5782,7 +5795,7 @@ 

    Parameters

    Name Description - user * + body *

    Created user object

    -
    +
    @@ -5887,15 +5900,16 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] body = ; // array[User] | try { - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); } } -}
    +} +
    @@ -5905,9 +5919,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] body = ; // array[User] | try { - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -5920,12 +5934,12 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    array[User] *user = ; // 
    +                              
    array[User] *body = ; // 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Creates list of users with given input array
    -[apiInstance createUsersWithArrayInputWith:user
    +[apiInstance createUsersWithArrayInputWith:body
                   completionHandler: ^(NSError* error) {
                                 if (error) {
                                     NSLog(@"Error: %@", error);
    @@ -5938,7 +5952,7 @@ 

    Usage and SDK Samples

    var OpenApiPetstore = require('open_api_petstore');
     
     var api = new OpenApiPetstore.UserApi()
    -var user = ; // {array[User]} 
    +var body = ; // {array[User]} 
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -5947,7 +5961,7 @@ 

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.createUsersWithArrayInput(user, callback); +api.createUsersWithArrayInput(body, callback);
    @@ -5969,12 +5983,12 @@

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var user = new array[User](); // array[User] | + var body = new array[User](); // array[User] | try { // Creates list of users with given input array - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (Exception e) { @@ -5991,10 +6005,10 @@

    Usage and SDK Samples

    require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$user = ; // array[User] | +$body = ; // array[User] | try { - $api_instance->createUsersWithArrayInput($user); + $api_instance->createUsersWithArrayInput($body); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL; } @@ -6007,10 +6021,10 @@

    Usage and SDK Samples

    use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | +my $body = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | eval { - $api_instance->createUsersWithArrayInput(user => $user); + $api_instance->createUsersWithArrayInput(body => $body); }; if ($@) { warn "Exception when calling UserApi->createUsersWithArrayInput: $@\n"; @@ -6026,11 +6040,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -user = # array[User] | +body = # array[User] | try: # Creates list of users with given input array - api_instance.create_users_with_array_input(user) + api_instance.create_users_with_array_input(body) except ApiException as e: print("Exception when calling UserApi->createUsersWithArrayInput: %s\n" % e)
    @@ -6039,10 +6053,10 @@

    Usage and SDK Samples

    extern crate UserApi;
     
     pub fn main() {
    -    let user = ; // array[User]
    +    let body = ; // array[User]
     
         let mut context = UserApi::Context::default();
    -    let result = client.createUsersWithArrayInput(user, &context).wait();
    +    let result = client.createUsersWithArrayInput(body, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -6065,7 +6079,7 @@ 

    Parameters

    Name Description - user * + body *

    List of user object

    -
    +
    @@ -6170,15 +6184,16 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] body = ; // array[User] | try { - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); } } -}
    +} +
    @@ -6188,9 +6203,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] body = ; // array[User] | try { - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -6203,12 +6218,12 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    array[User] *user = ; // 
    +                              
    array[User] *body = ; // 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Creates list of users with given input array
    -[apiInstance createUsersWithListInputWith:user
    +[apiInstance createUsersWithListInputWith:body
                   completionHandler: ^(NSError* error) {
                                 if (error) {
                                     NSLog(@"Error: %@", error);
    @@ -6221,7 +6236,7 @@ 

    Usage and SDK Samples

    var OpenApiPetstore = require('open_api_petstore');
     
     var api = new OpenApiPetstore.UserApi()
    -var user = ; // {array[User]} 
    +var body = ; // {array[User]} 
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -6230,7 +6245,7 @@ 

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.createUsersWithListInput(user, callback); +api.createUsersWithListInput(body, callback);
    @@ -6252,12 +6267,12 @@

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var user = new array[User](); // array[User] | + var body = new array[User](); // array[User] | try { // Creates list of users with given input array - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (Exception e) { @@ -6274,10 +6289,10 @@

    Usage and SDK Samples

    require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$user = ; // array[User] | +$body = ; // array[User] | try { - $api_instance->createUsersWithListInput($user); + $api_instance->createUsersWithListInput($body); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL; } @@ -6290,10 +6305,10 @@

    Usage and SDK Samples

    use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | +my $body = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | eval { - $api_instance->createUsersWithListInput(user => $user); + $api_instance->createUsersWithListInput(body => $body); }; if ($@) { warn "Exception when calling UserApi->createUsersWithListInput: $@\n"; @@ -6309,11 +6324,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -user = # array[User] | +body = # array[User] | try: # Creates list of users with given input array - api_instance.create_users_with_list_input(user) + api_instance.create_users_with_list_input(body) except ApiException as e: print("Exception when calling UserApi->createUsersWithListInput: %s\n" % e)
    @@ -6322,10 +6337,10 @@

    Usage and SDK Samples

    extern crate UserApi;
     
     pub fn main() {
    -    let user = ; // array[User]
    +    let body = ; // array[User]
     
         let mut context = UserApi::Context::default();
    -    let result = client.createUsersWithListInput(user, &context).wait();
    +    let result = client.createUsersWithListInput(body, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -6348,7 +6363,7 @@ 

    Parameters

    Name Description - user * + body *

    List of user object

    -
    +
    @@ -6461,7 +6476,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -}
    +} +
    @@ -6486,7 +6502,7 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *username = username_example; // The name that needs to be deleted
    +                              
    String *username = username_example; // The name that needs to be deleted (default to null)
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -6535,7 +6551,7 @@ 

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var username = username_example; // String | The name that needs to be deleted + var username = username_example; // String | The name that needs to be deleted (default to null) try { @@ -6592,7 +6608,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The name that needs to be deleted +username = username_example # String | The name that needs to be deleted (default to null) try: # Delete user @@ -6764,7 +6780,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -}
    +} +
    @@ -6790,7 +6807,7 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *username = username_example; // The name that needs to be fetched. Use user1 for testing.
    +                              
    String *username = username_example; // The name that needs to be fetched. Use user1 for testing. (default to null)
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -6842,7 +6859,7 @@ 

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. + var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. (default to null) try { @@ -6902,7 +6919,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The name that needs to be fetched. Use user1 for testing. +username = username_example # String | The name that needs to be fetched. Use user1 for testing. (default to null) try: # Get user by user name @@ -7142,7 +7159,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -}
    +} +
    @@ -7169,8 +7187,8 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *username = username_example; // The user name for login
    -String *password = password_example; // The password for login in clear text
    +                              
    String *username = username_example; // The user name for login (default to null)
    +String *password = password_example; // The password for login in clear text (default to null)
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -7224,8 +7242,8 @@ 

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var username = username_example; // String | The user name for login - var password = password_example; // String | The password for login in clear text + var username = username_example; // String | The user name for login (default to null) + var password = password_example; // String | The password for login in clear text (default to null) try { @@ -7287,8 +7305,8 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The user name for login -password = password_example # String | The password for login in clear text +username = username_example # String | The user name for login (default to null) +password = password_example # String | The password for login in clear text (default to null) try: # Logs user into the system @@ -7568,7 +7586,8 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -}
    +} +
    @@ -7802,15 +7821,16 @@

    Usage and SDK Samples

    UserApi apiInstance = new UserApi(); String username = username_example; // String | name that need to be deleted - User user = ; // User | + User body = ; // User | try { - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); } } -} +} +
    @@ -7821,9 +7841,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); String username = username_example; // String | name that need to be deleted - User user = ; // User | + User body = ; // User | try { - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -7836,14 +7856,14 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *username = username_example; // name that need to be deleted
    -User *user = ; // 
    +                              
    String *username = username_example; // name that need to be deleted (default to null)
    +User *body = ; // 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Updated user
     [apiInstance updateUserWith:username
    -    user:user
    +    body:body
                   completionHandler: ^(NSError* error) {
                                 if (error) {
                                     NSLog(@"Error: %@", error);
    @@ -7857,7 +7877,7 @@ 

    Usage and SDK Samples

    var api = new OpenApiPetstore.UserApi() var username = username_example; // {String} name that need to be deleted -var user = ; // {User} +var body = ; // {User} var callback = function(error, data, response) { if (error) { @@ -7866,7 +7886,7 @@

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.updateUser(username, user, callback); +api.updateUser(username, body, callback);
    @@ -7888,13 +7908,13 @@

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var username = username_example; // String | name that need to be deleted - var user = new User(); // User | + var username = username_example; // String | name that need to be deleted (default to null) + var body = new User(); // User | try { // Updated user - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (Exception e) { @@ -7912,10 +7932,10 @@

    Usage and SDK Samples

    $api_instance = new OpenAPITools\Client\Api\UserApi(); $username = username_example; // String | name that need to be deleted -$user = ; // User | +$body = ; // User | try { - $api_instance->updateUser($username, $user); + $api_instance->updateUser($username, $body); } catch (Exception $e) { echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL; } @@ -7929,10 +7949,10 @@

    Usage and SDK Samples

    my $api_instance = WWW::OPenAPIClient::UserApi->new(); my $username = username_example; # String | name that need to be deleted -my $user = WWW::OPenAPIClient::Object::User->new(); # User | +my $body = WWW::OPenAPIClient::Object::User->new(); # User | eval { - $api_instance->updateUser(username => $username, user => $user); + $api_instance->updateUser(username => $username, body => $body); }; if ($@) { warn "Exception when calling UserApi->updateUser: $@\n"; @@ -7948,12 +7968,12 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | name that need to be deleted -user = # User | +username = username_example # String | name that need to be deleted (default to null) +body = # User | try: # Updated user - api_instance.update_user(username, user) + api_instance.update_user(username, body) except ApiException as e: print("Exception when calling UserApi->updateUser: %s\n" % e)
    @@ -7963,10 +7983,10 @@

    Usage and SDK Samples

    pub fn main() { let username = username_example; // String - let user = ; // User + let body = ; // User let mut context = UserApi::Context::default(); - let result = client.updateUser(username, user, &context).wait(); + let result = client.updateUser(username, body, &context).wait(); println!("{:?}", result); } @@ -8019,7 +8039,7 @@

    Parameters

    Name Description - user * + body *

    Updated user object

    -
    +
    diff --git a/samples/documentation/markdown/.openapi-generator/VERSION b/samples/documentation/markdown/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/documentation/markdown/.openapi-generator/VERSION +++ b/samples/documentation/markdown/.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/documentation/markdown/Apis/StoreApi.md b/samples/documentation/markdown/Apis/StoreApi.md index 9b7ce9f21f0f..9f1c05ae2f8a 100644 --- a/samples/documentation/markdown/Apis/StoreApi.md +++ b/samples/documentation/markdown/Apis/StoreApi.md @@ -50,7 +50,7 @@ This endpoint does not need any parameter. ### Return type -[**Map**](/Models/integer.md) +[**Map**](..//Models/integer.md) ### Authorization @@ -77,7 +77,7 @@ Name | Type | Description | Notes ### Return type -[**Order**](/Models/Order.md) +[**Order**](..//Models/Order.md) ### Authorization @@ -98,11 +98,11 @@ Place an order for a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](/Models/Order.md)| order placed for purchasing the pet | + **body** | [**Order**](..//Models/Order.md)| order placed for purchasing the pet | ### Return type -[**Order**](/Models/Order.md) +[**Order**](..//Models/Order.md) ### Authorization diff --git a/samples/documentation/markdown/Apis/UserApi.md b/samples/documentation/markdown/Apis/UserApi.md index f92b65c33449..75321e5bb02b 100644 --- a/samples/documentation/markdown/Apis/UserApi.md +++ b/samples/documentation/markdown/Apis/UserApi.md @@ -26,7 +26,7 @@ Create user Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](/Models/User.md)| Created user object | + **body** | [**User**](..//Models/User.md)| Created user object | ### Return type @@ -51,7 +51,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List**](/Models/User.md)| List of user object | + **body** | [**List**](..//Models/User.md)| List of user object | ### Return type @@ -76,7 +76,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List**](/Models/User.md)| List of user object | + **body** | [**List**](..//Models/User.md)| List of user object | ### Return type @@ -132,7 +132,7 @@ Name | Type | Description | Notes ### Return type -[**User**](/Models/User.md) +[**User**](..//Models/User.md) ### Authorization @@ -158,7 +158,7 @@ Name | Type | Description | Notes ### Return type -[**String**](/Models/string.md) +[**String**](..//Models/string.md) ### Authorization @@ -204,7 +204,7 @@ Updated user Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **body** | [**User**](/Models/User.md)| Updated user object | + **body** | [**User**](..//Models/User.md)| Updated user object | ### Return type diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index 94bf4e677615..bfbf77eb7fad 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.3-SNAPSHOT +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION b/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION index 717311e32e3c..bfbf77eb7fad 100644 --- a/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION @@ -1 +1 @@ -unset \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-restbed/api/PetApi.cpp b/samples/server/petstore/cpp-restbed/api/PetApi.cpp index aadfcd871e8f..cdb647763619 100644 --- a/samples/server/petstore/cpp-restbed/api/PetApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/PetApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -66,9 +66,6 @@ PetApiPetResource::PetApiPetResource() this->set_method_handler("PUT", std::bind(&PetApiPetResource::PUT_method_handler, this, std::placeholders::_1)); - - body = std::make_shared(); - } PetApiPetResource::~PetApiPetResource() @@ -181,10 +178,6 @@ PetApiPetPetIdResource::PetApiPetPetIdResource() this->set_method_handler("POST", std::bind(&PetApiPetPetIdResource::POST_method_handler, this, std::placeholders::_1)); - - petId = 0L; - apiKey = ""; - } PetApiPetPetIdResource::~PetApiPetPetIdResource() @@ -309,8 +302,6 @@ PetApiPetFindByStatusResource::PetApiPetFindByStatusResource() this->set_method_handler("GET", std::bind(&PetApiPetFindByStatusResource::GET_method_handler, this, std::placeholders::_1)); - - } PetApiPetFindByStatusResource::~PetApiPetFindByStatusResource() @@ -363,8 +354,6 @@ PetApiPetFindByTagsResource::PetApiPetFindByTagsResource() this->set_method_handler("GET", std::bind(&PetApiPetFindByTagsResource::GET_method_handler, this, std::placeholders::_1)); - - } PetApiPetFindByTagsResource::~PetApiPetFindByTagsResource() @@ -417,11 +406,6 @@ PetApiPetPetIdUploadImageResource::PetApiPetPetIdUploadImageResource() this->set_method_handler("POST", std::bind(&PetApiPetPetIdUploadImageResource::POST_method_handler, this, std::placeholders::_1)); - - petId = 0L; - additionalMetadata = ""; - file = ""; - } PetApiPetPetIdUploadImageResource::~PetApiPetPetIdUploadImageResource() diff --git a/samples/server/petstore/cpp-restbed/api/PetApi.h b/samples/server/petstore/cpp-restbed/api/PetApi.h index 41a117a885bc..f437fbadb417 100644 --- a/samples/server/petstore/cpp-restbed/api/PetApi.h +++ b/samples/server/petstore/cpp-restbed/api/PetApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -83,7 +83,7 @@ class PetApiPetResource: public restbed::Resource std::shared_ptr const & )> handler_PUT_; - std::shared_ptr body; + std::shared_ptr body{}; }; /// @@ -130,8 +130,8 @@ class PetApiPetPetIdResource: public restbed::Resource int64_t const &, std::string const &, std::string const & )> handler_POST_; - int64_t petId; - std::string apiKey; + int64_t petId{}; + std::string apiKey{}; }; /// @@ -160,7 +160,7 @@ class PetApiPetFindByStatusResource: public restbed::Resource )> handler_GET_; - std::vector status; + std::vector status{}; }; /// @@ -189,7 +189,7 @@ class PetApiPetFindByTagsResource: public restbed::Resource )> handler_GET_; - std::vector tags; + std::vector tags{}; }; /// @@ -218,9 +218,9 @@ class PetApiPetPetIdUploadImageResource: public restbed::Resource )> handler_POST_; - int64_t petId; - std::string additionalMetadata; - std::string file; + int64_t petId{}; + std::string additionalMetadata{}; + std::string file{}; }; diff --git a/samples/server/petstore/cpp-restbed/api/StoreApi.cpp b/samples/server/petstore/cpp-restbed/api/StoreApi.cpp index 58cd31964df8..aeafb01c6f2b 100644 --- a/samples/server/petstore/cpp-restbed/api/StoreApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/StoreApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -60,9 +60,6 @@ StoreApiStoreOrderOrderIdResource::StoreApiStoreOrderOrderIdResource() this->set_method_handler("GET", std::bind(&StoreApiStoreOrderOrderIdResource::GET_method_handler, this, std::placeholders::_1)); - - orderId = ""; - } StoreApiStoreOrderOrderIdResource::~StoreApiStoreOrderOrderIdResource() @@ -157,8 +154,6 @@ StoreApiStoreInventoryResource::StoreApiStoreInventoryResource() this->set_method_handler("GET", std::bind(&StoreApiStoreInventoryResource::GET_method_handler, this, std::placeholders::_1)); - - } StoreApiStoreInventoryResource::~StoreApiStoreInventoryResource() @@ -206,9 +201,6 @@ StoreApiStoreOrderResource::StoreApiStoreOrderResource() this->set_method_handler("POST", std::bind(&StoreApiStoreOrderResource::POST_method_handler, this, std::placeholders::_1)); - - body = std::make_shared(); - } StoreApiStoreOrderResource::~StoreApiStoreOrderResource() diff --git a/samples/server/petstore/cpp-restbed/api/StoreApi.h b/samples/server/petstore/cpp-restbed/api/StoreApi.h index 80769bd55d63..f23bddfe3344 100644 --- a/samples/server/petstore/cpp-restbed/api/StoreApi.h +++ b/samples/server/petstore/cpp-restbed/api/StoreApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -83,7 +83,7 @@ class StoreApiStoreOrderOrderIdResource: public restbed::Resource int64_t const & )> handler_GET_; - std::string orderId; + std::string orderId{}; }; /// @@ -140,7 +140,7 @@ class StoreApiStoreOrderResource: public restbed::Resource )> handler_POST_; - std::shared_ptr body; + std::shared_ptr body{}; }; diff --git a/samples/server/petstore/cpp-restbed/api/UserApi.cpp b/samples/server/petstore/cpp-restbed/api/UserApi.cpp index 9e0bb6d0c1db..918b94ecd82f 100644 --- a/samples/server/petstore/cpp-restbed/api/UserApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/UserApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -66,9 +66,6 @@ UserApiUserResource::UserApiUserResource() this->set_method_handler("POST", std::bind(&UserApiUserResource::POST_method_handler, this, std::placeholders::_1)); - - body = std::make_shared(); - } UserApiUserResource::~UserApiUserResource() @@ -128,8 +125,6 @@ UserApiUserCreateWithArrayResource::UserApiUserCreateWithArrayResource() this->set_method_handler("POST", std::bind(&UserApiUserCreateWithArrayResource::POST_method_handler, this, std::placeholders::_1)); - - } UserApiUserCreateWithArrayResource::~UserApiUserCreateWithArrayResource() @@ -189,8 +184,6 @@ UserApiUserCreateWithListResource::UserApiUserCreateWithListResource() this->set_method_handler("POST", std::bind(&UserApiUserCreateWithListResource::POST_method_handler, this, std::placeholders::_1)); - - } UserApiUserCreateWithListResource::~UserApiUserCreateWithListResource() @@ -256,9 +249,6 @@ UserApiUserUsernameResource::UserApiUserUsernameResource() this->set_method_handler("PUT", std::bind(&UserApiUserUsernameResource::PUT_method_handler, this, std::placeholders::_1)); - - username = ""; - } UserApiUserUsernameResource::~UserApiUserUsernameResource() @@ -398,10 +388,6 @@ UserApiUserLoginResource::UserApiUserLoginResource() this->set_method_handler("GET", std::bind(&UserApiUserLoginResource::GET_method_handler, this, std::placeholders::_1)); - - username = ""; - password = ""; - } UserApiUserLoginResource::~UserApiUserLoginResource() @@ -460,8 +446,6 @@ UserApiUserLogoutResource::UserApiUserLogoutResource() this->set_method_handler("GET", std::bind(&UserApiUserLogoutResource::GET_method_handler, this, std::placeholders::_1)); - - } UserApiUserLogoutResource::~UserApiUserLogoutResource() diff --git a/samples/server/petstore/cpp-restbed/api/UserApi.h b/samples/server/petstore/cpp-restbed/api/UserApi.h index 6fff9c23b445..970bd05ee720 100644 --- a/samples/server/petstore/cpp-restbed/api/UserApi.h +++ b/samples/server/petstore/cpp-restbed/api/UserApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -74,7 +74,7 @@ class UserApiUserResource: public restbed::Resource )> handler_POST_; - std::shared_ptr body; + std::shared_ptr body{}; }; /// @@ -103,7 +103,7 @@ class UserApiUserCreateWithArrayResource: public restbed::Resource )> handler_POST_; - std::vector> body; + std::vector> body{}; }; /// @@ -132,7 +132,7 @@ class UserApiUserCreateWithListResource: public restbed::Resource )> handler_POST_; - std::vector> body; + std::vector> body{}; }; /// @@ -179,7 +179,7 @@ class UserApiUserUsernameResource: public restbed::Resource std::string const &, std::shared_ptr const & )> handler_PUT_; - std::string username; + std::string username{}; }; /// @@ -208,8 +208,8 @@ class UserApiUserLoginResource: public restbed::Resource )> handler_GET_; - std::string username; - std::string password; + std::string username{}; + std::string password{}; }; /// diff --git a/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp b/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp index 7d9f5217bc57..d1354e330475 100644 --- a/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp +++ b/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/ApiResponse.h b/samples/server/petstore/cpp-restbed/model/ApiResponse.h index db8615f17d55..493b5f1f32eb 100644 --- a/samples/server/petstore/cpp-restbed/model/ApiResponse.h +++ b/samples/server/petstore/cpp-restbed/model/ApiResponse.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Category.cpp b/samples/server/petstore/cpp-restbed/model/Category.cpp index 5e79804804b2..7efa1e38878f 100644 --- a/samples/server/petstore/cpp-restbed/model/Category.cpp +++ b/samples/server/petstore/cpp-restbed/model/Category.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Category.h b/samples/server/petstore/cpp-restbed/model/Category.h index 1d542d544679..1fa0c7bf2364 100644 --- a/samples/server/petstore/cpp-restbed/model/Category.h +++ b/samples/server/petstore/cpp-restbed/model/Category.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Order.cpp b/samples/server/petstore/cpp-restbed/model/Order.cpp index 108a7f76103b..7aae7b9cbb6a 100644 --- a/samples/server/petstore/cpp-restbed/model/Order.cpp +++ b/samples/server/petstore/cpp-restbed/model/Order.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Order.h b/samples/server/petstore/cpp-restbed/model/Order.h index 3edc54e353e9..fc01d94d1cc3 100644 --- a/samples/server/petstore/cpp-restbed/model/Order.h +++ b/samples/server/petstore/cpp-restbed/model/Order.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Pet.cpp b/samples/server/petstore/cpp-restbed/model/Pet.cpp index 5c7cff352780..5c677db19807 100644 --- a/samples/server/petstore/cpp-restbed/model/Pet.cpp +++ b/samples/server/petstore/cpp-restbed/model/Pet.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -75,10 +75,12 @@ ptree Pet::toPropertyTree() pt.add_child("photoUrls", tmp_node); tmp_node.clear(); } - // generate tree for vector of pointers of Tags + // generate tree for Tags if (!m_Tags.empty()) { for (const auto &childEntry : m_Tags) { - tmp_node.push_back(std::make_pair("", childEntry->toPropertyTree())); + ptree Tags_node; + Tags_node.put("", childEntry); + tmp_node.push_back(std::make_pair("", Tags_node)); } pt.add_child("tags", tmp_node); tmp_node.clear(); @@ -102,11 +104,10 @@ void Pet::fromPropertyTree(ptree const &pt) m_PhotoUrls.emplace_back(childTree.second.data()); } } - // generate new Tag Object for each item and assign it to the current + // push all items of Tags into member vector if (pt.get_child_optional("tags")) { for (const auto &childTree : pt.get_child("tags")) { - m_Tags.emplace_back(std::make_shared()); - m_Tags.back()->fromPropertyTree(childTree.second); + m_Tags.emplace_back(childTree.second.data()); } } setStatus(pt.get("status", "")); diff --git a/samples/server/petstore/cpp-restbed/model/Pet.h b/samples/server/petstore/cpp-restbed/model/Pet.h index b5e97be03128..7376ebbb19c3 100644 --- a/samples/server/petstore/cpp-restbed/model/Pet.h +++ b/samples/server/petstore/cpp-restbed/model/Pet.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Tag.cpp b/samples/server/petstore/cpp-restbed/model/Tag.cpp index 200204322453..0c5940f0e41d 100644 --- a/samples/server/petstore/cpp-restbed/model/Tag.cpp +++ b/samples/server/petstore/cpp-restbed/model/Tag.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Tag.h b/samples/server/petstore/cpp-restbed/model/Tag.h index 27248c61a1f4..b428d9bc3bac 100644 --- a/samples/server/petstore/cpp-restbed/model/Tag.h +++ b/samples/server/petstore/cpp-restbed/model/Tag.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/User.cpp b/samples/server/petstore/cpp-restbed/model/User.cpp index 6d22aab6f8ce..0ff1e77036b2 100644 --- a/samples/server/petstore/cpp-restbed/model/User.cpp +++ b/samples/server/petstore/cpp-restbed/model/User.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/User.h b/samples/server/petstore/cpp-restbed/model/User.h index b8c807ac4e97..062222195e6c 100644 --- a/samples/server/petstore/cpp-restbed/model/User.h +++ b/samples/server/petstore/cpp-restbed/model/User.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator unset. + * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION b/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION index 0e97bd19efbf..bfbf77eb7fad 100644 --- a/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION +++ b/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.3-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION b/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION index 0e97bd19efbf..bfbf77eb7fad 100644 --- a/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION +++ b/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.3-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandler.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandler.fs index 634acdf18752..6c908b8f8d9e 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandler.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandler.fs @@ -29,6 +29,8 @@ module PetApiHandler = let serviceArgs = { bodyParams=bodyParams } : AddPetArgs let result = PetApiService.AddPet ctx serviceArgs return! (match result with + | AddPetDefaultStatusCode resolved -> + setStatusCode 200 >=> json resolved.content | AddPetStatusCode405 resolved -> setStatusCode 405 >=> text resolved.content ) next ctx @@ -129,6 +131,8 @@ module PetApiHandler = let serviceArgs = { bodyParams=bodyParams } : UpdatePetArgs let result = PetApiService.UpdatePet ctx serviceArgs return! (match result with + | UpdatePetDefaultStatusCode resolved -> + setStatusCode 200 >=> json resolved.content | UpdatePetStatusCode400 resolved -> setStatusCode 400 >=> text resolved.content | UpdatePetStatusCode404 resolved -> diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandlerParams.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandlerParams.fs index f84ffb76b22c..50d343fa1756 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandlerParams.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandlerParams.fs @@ -14,11 +14,16 @@ module PetApiHandlerParams = //#endregion + type AddPetDefaultStatusCodeResponse = { + content:Pet; + + } + type AddPetStatusCode405Response = { content:string; } - type AddPetResult = AddPetStatusCode405 of AddPetStatusCode405Response + type AddPetResult = AddPetDefaultStatusCode of AddPetDefaultStatusCodeResponse|AddPetStatusCode405 of AddPetStatusCode405Response type AddPetArgs = { bodyParams:AddPetBodyParams @@ -130,6 +135,11 @@ module PetApiHandlerParams = //#endregion + type UpdatePetDefaultStatusCodeResponse = { + content:Pet; + + } + type UpdatePetStatusCode400Response = { content:string; @@ -144,7 +154,7 @@ module PetApiHandlerParams = content:string; } - type UpdatePetResult = UpdatePetStatusCode400 of UpdatePetStatusCode400Response|UpdatePetStatusCode404 of UpdatePetStatusCode404Response|UpdatePetStatusCode405 of UpdatePetStatusCode405Response + type UpdatePetResult = UpdatePetDefaultStatusCode of UpdatePetDefaultStatusCodeResponse|UpdatePetStatusCode400 of UpdatePetStatusCode400Response|UpdatePetStatusCode404 of UpdatePetStatusCode404Response|UpdatePetStatusCode405 of UpdatePetStatusCode405Response type UpdatePetArgs = { bodyParams:UpdatePetBodyParams diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/PetApiService.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/PetApiService.fs index 948ee5ce71a2..c7a6f3adb8b9 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/PetApiService.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/PetApiService.fs @@ -14,6 +14,10 @@ module PetApiServiceImplementation = interface IPetApiService with member this.AddPet ctx args = + if true then + let content = "successful operation" :> obj :?> Pet // this cast is obviously wrong, and is only intended to allow generated project to compile + AddPetDefaultStatusCode { content = content } + else let content = "Invalid input" AddPetStatusCode405 { content = content } @@ -50,6 +54,9 @@ module PetApiServiceImplementation = member this.UpdatePet ctx args = if true then + let content = "successful operation" :> obj :?> Pet // this cast is obviously wrong, and is only intended to allow generated project to compile + UpdatePetDefaultStatusCode { content = content } + else if true then let content = "Invalid ID supplied" UpdatePetStatusCode400 { content = content } else if true then diff --git a/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION b/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION index afa636560641..bfbf77eb7fad 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION +++ b/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION index c3a2c7076fa8..bfbf77eb7fad 100644 --- a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION +++ b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-inflector/.openapi-generator/VERSION b/samples/server/petstore/java-inflector/.openapi-generator/VERSION index dde25ef08e8c..bfbf77eb7fad 100644 --- a/samples/server/petstore/java-inflector/.openapi-generator/VERSION +++ b/samples/server/petstore/java-inflector/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index f9d5285bb6e6..5485142beac2 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -15,44 +16,224 @@ public class AdditionalPropertiesClass { - @JsonProperty("map_property") - private Map mapProperty = null; + @JsonProperty("map_string") + private Map mapString = null; - @JsonProperty("map_of_map_property") - private Map> mapOfMapProperty = null; + @JsonProperty("map_number") + private Map mapNumber = null; + + @JsonProperty("map_integer") + private Map mapInteger = null; + + @JsonProperty("map_boolean") + private Map mapBoolean = null; + + @JsonProperty("map_array_integer") + private Map> mapArrayInteger = null; + + @JsonProperty("map_array_anytype") + private Map> mapArrayAnytype = null; + + @JsonProperty("map_map_string") + private Map> mapMapString = null; + + @JsonProperty("map_map_anytype") + private Map> mapMapAnytype = null; + + @JsonProperty("anytype_1") + private Object anytype1; + + @JsonProperty("anytype_2") + private Object anytype2; + + @JsonProperty("anytype_3") + private Object anytype3; + + /** + **/ + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_string") + public Map getMapString() { + return mapString; + } + public void setMapString(Map mapString) { + this.mapString = mapString; + } + + /** + **/ + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_number") + public Map getMapNumber() { + return mapNumber; + } + public void setMapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + } + + /** + **/ + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_integer") + public Map getMapInteger() { + return mapInteger; + } + public void setMapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + } + + /** + **/ + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_boolean") + public Map getMapBoolean() { + return mapBoolean; + } + public void setMapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + } + + /** + **/ + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + public void setMapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + } + + /** + **/ + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + public void setMapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + } + + /** + **/ + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_map_string") + public Map> getMapMapString() { + return mapMapString; + } + public void setMapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + } + + /** + **/ + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + /** + **/ + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("anytype_1") + public Object getAnytype1() { + return anytype1; + } + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } /** **/ - public AdditionalPropertiesClass mapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_property") - public Map getMapProperty() { - return mapProperty; + @JsonProperty("anytype_2") + public Object getAnytype2() { + return anytype2; } - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public void setAnytype2(Object anytype2) { + this.anytype2 = anytype2; } /** **/ - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_of_map_property") - public Map> getMapOfMapProperty() { - return mapOfMapProperty; + @JsonProperty("anytype_3") + public Object getAnytype3() { + return anytype3; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; } @@ -65,13 +246,22 @@ public boolean equals(java.lang.Object o) { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + return Objects.equals(mapString, additionalPropertiesClass.mapString) && + Objects.equals(mapNumber, additionalPropertiesClass.mapNumber) && + Objects.equals(mapInteger, additionalPropertiesClass.mapInteger) && + Objects.equals(mapBoolean, additionalPropertiesClass.mapBoolean) && + Objects.equals(mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && + Objects.equals(mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && + Objects.equals(mapMapString, additionalPropertiesClass.mapMapString) && + Objects.equals(mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + Objects.equals(anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(anytype3, additionalPropertiesClass.anytype3); } @Override public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } @Override @@ -79,8 +269,17 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); + sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); + sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); + sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); + sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); + sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); + sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); + sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); + sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java index dd9447b5ebef..bfcf5486f248 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java @@ -15,7 +15,7 @@ public class Animal { @JsonProperty("className") - private String className = null; + private String className; @JsonProperty("color") private String color = "red"; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java index 02af8353e587..5ac9b3add792 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java @@ -13,22 +13,22 @@ public class Capitalization { @JsonProperty("smallCamel") - private String smallCamel = null; + private String smallCamel; @JsonProperty("CapitalCamel") - private String capitalCamel = null; + private String capitalCamel; @JsonProperty("small_Snake") - private String smallSnake = null; + private String smallSnake; @JsonProperty("Capital_Snake") - private String capitalSnake = null; + private String capitalSnake; @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints = null; + private String scAETHFlowPoints; @JsonProperty("ATT_NAME") - private String ATT_NAME = null; + private String ATT_NAME; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java index 5335d698a8b2..c8a9293aba98 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; +import org.openapitools.model.CatAllOf; @@ -14,7 +15,7 @@ public class Cat extends Animal { @JsonProperty("declawed") - private Boolean declawed = null; + private Boolean declawed; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java index 873014460b2e..fe52381c0934 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java @@ -13,10 +13,10 @@ public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name = "default-name"; /** **/ @@ -43,7 +43,7 @@ public Category name(String name) { } - @ApiModelProperty(value = "") + @ApiModelProperty(required = true, value = "") @JsonProperty("name") public String getName() { return name; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java index d01849217ed0..ca34fbd20177 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java @@ -16,7 +16,7 @@ public class ClassModel { @JsonProperty("_class") - private String propertyClass = null; + private String propertyClass; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java index 9e2392899fa4..a1838210b476 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java @@ -13,7 +13,7 @@ public class Client { @JsonProperty("client") - private String client = null; + private String client; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java index 3cc5ac3dad58..9198fef58d58 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; +import org.openapitools.model.DogAllOf; @@ -14,7 +15,7 @@ public class Dog extends Animal { @JsonProperty("breed") - private String breed = null; + private String breed; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java index e53b95e708fb..56b5ce98e147 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java @@ -42,12 +42,12 @@ public static JustSymbolEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol = null; + private JustSymbolEnum justSymbol; /** * Gets or Sets arrayEnum @@ -76,7 +76,7 @@ public static ArrayEnumEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java index 04b4b96e1633..c0e2beefb8a0 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java @@ -37,7 +37,7 @@ public static EnumClass fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java index c3aa4764bd05..4c3d4a46380e 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java @@ -43,12 +43,12 @@ public static EnumStringEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("enum_string") - private EnumStringEnum enumString = null; + private EnumStringEnum enumString; /** * Gets or Sets enumStringRequired @@ -79,12 +79,12 @@ public static EnumStringRequiredEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired = null; + private EnumStringRequiredEnum enumStringRequired; /** * Gets or Sets enumInteger @@ -113,12 +113,12 @@ public static EnumIntegerEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger = null; + private EnumIntegerEnum enumInteger; /** * Gets or Sets enumNumber @@ -147,15 +147,15 @@ public static EnumNumberEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("enum_number") - private EnumNumberEnum enumNumber = null; + private EnumNumberEnum enumNumber; @JsonProperty("outerEnum") - private OuterEnum outerEnum = null; + private OuterEnum outerEnum; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index c02bc42218b7..2c58dcd87887 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -15,7 +15,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") private List files = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java index b755b19fda8d..c962633574c1 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java @@ -17,43 +17,46 @@ public class FormatTest { @JsonProperty("integer") - private Integer integer = null; + private Integer integer; @JsonProperty("int32") - private Integer int32 = null; + private Integer int32; @JsonProperty("int64") - private Long int64 = null; + private Long int64; @JsonProperty("number") - private BigDecimal number = null; + private BigDecimal number; @JsonProperty("float") - private Float _float = null; + private Float _float; @JsonProperty("double") - private Double _double = null; + private Double _double; @JsonProperty("string") - private String string = null; + private String string; @JsonProperty("byte") - private byte[] _byte = null; + private byte[] _byte; @JsonProperty("binary") - private File binary = null; + private File binary; @JsonProperty("date") - private Date date = null; + private Date date; @JsonProperty("dateTime") - private Date dateTime = null; + private Date dateTime; @JsonProperty("uuid") - private UUID uuid = null; + private UUID uuid; @JsonProperty("password") - private String password = null; + private String password; + + @JsonProperty("BigDecimal") + private BigDecimal bigDecimal; /** * minimum: 10 @@ -260,7 +263,7 @@ public FormatTest uuid(UUID uuid) { } - @ApiModelProperty(value = "") + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") public UUID getUuid() { return uuid; @@ -286,6 +289,23 @@ public void setPassword(String password) { this.password = password; } + /** + **/ + public FormatTest bigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") + public BigDecimal getBigDecimal() { + return bigDecimal; + } + public void setBigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + } + @Override public boolean equals(java.lang.Object o) { @@ -308,12 +328,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(date, formatTest.date) && Objects.equals(dateTime, formatTest.dateTime) && Objects.equals(uuid, formatTest.uuid) && - Objects.equals(password, formatTest.password); + Objects.equals(password, formatTest.password) && + Objects.equals(bigDecimal, formatTest.bigDecimal); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); } @Override @@ -334,6 +355,7 @@ public String toString() { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 7dce1117eb1c..b3c40ffb503e 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,10 +13,10 @@ public class HasOnlyReadOnly { @JsonProperty("bar") - private String bar = null; + private String bar; @JsonProperty("foo") - private String foo = null; + private String foo; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java index 2ba14f914ebe..7f22d852e3c1 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java @@ -9,7 +9,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; @@ -47,7 +46,7 @@ public static InnerEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @@ -58,7 +57,7 @@ public static InnerEnum fromValue(String text) { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; /** **/ @@ -113,7 +112,7 @@ public void setDirectMap(Map directMap) { /** **/ - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } @@ -121,10 +120,10 @@ public MapTest indirectMap(StringBooleanMap indirectMap) { @ApiModelProperty(value = "") @JsonProperty("indirect_map") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1a09fa8a7f22..24b4ef0e1e71 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -19,10 +19,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private UUID uuid = null; + private UUID uuid; @JsonProperty("dateTime") - private Date dateTime = null; + private Date dateTime; @JsonProperty("map") private Map map = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java index 84f8223b8040..d2bb54537374 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java @@ -16,10 +16,10 @@ public class Model200Response { @JsonProperty("name") - private Integer name = null; + private Integer name; @JsonProperty("class") - private String propertyClass = null; + private String propertyClass; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java index 9e77e3f7d0d4..b711cae39dd0 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -13,13 +13,13 @@ public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java index 5e768ccc566a..990b7b9a36d4 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java @@ -16,7 +16,7 @@ public class ModelReturn { @JsonProperty("return") - private Integer _return = null; + private Integer _return; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java index 5ec8687a8ba6..e96e805ba3ce 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java @@ -16,16 +16,16 @@ public class Name { @JsonProperty("name") - private Integer name = null; + private Integer name; @JsonProperty("snake_case") - private Integer snakeCase = null; + private Integer snakeCase; @JsonProperty("property") - private String property = null; + private String property; @JsonProperty("123Number") - private Integer _123number = null; + private Integer _123number; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java index 24389e9446e5..8bb6fd8fe02f 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java @@ -14,7 +14,7 @@ public class NumberOnly { @JsonProperty("JustNumber") - private BigDecimal justNumber = null; + private BigDecimal justNumber; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java index 632b6f6e4ed6..ac70304afdaf 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java @@ -15,16 +15,16 @@ public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private Date shipDate = null; + private Date shipDate; /** * Order Status @@ -55,12 +55,12 @@ public static StatusEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java index cbbd53117cd3..6d46e00e23c0 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java @@ -14,13 +14,13 @@ public class OuterComposite { @JsonProperty("my_number") - private BigDecimal myNumber = null; + private BigDecimal myNumber; @JsonProperty("my_string") - private String myString = null; + private String myString; @JsonProperty("my_boolean") - private Boolean myBoolean = null; + private Boolean myBoolean; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java index d46baedf6c20..f7dc82feebdd 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java @@ -37,7 +37,7 @@ public static OuterEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java index 97a03717d3c9..822ca68e118e 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java @@ -18,13 +18,13 @@ public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList(); @@ -61,12 +61,12 @@ public static StatusEnum fromValue(String text) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 451402ed9bd3..6c2e27d8bc3d 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,10 +13,10 @@ public class ReadOnlyFirst { @JsonProperty("bar") - private String bar = null; + private String bar; @JsonProperty("baz") - private String baz = null; + private String baz; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java index a85a7e51fdc8..6582bf518848 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -13,7 +13,7 @@ public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long $specialPropertyName = null; + private Long $specialPropertyName; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java index fb242eaafd8f..24e27ce9b245 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java @@ -13,10 +13,10 @@ public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java index b991f07867a9..c1f4956c8e98 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java @@ -13,28 +13,28 @@ public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; /** **/ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java index 529234297d99..6c23f0dfa38d 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java @@ -21,7 +21,7 @@ public class AnotherFakeController { **/ /* - public ResponseContext testSpecialTags(RequestContext request , Client client) { + public ResponseContext call123testSpecialTags(RequestContext request , Client body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java index f3e1b163c24a..df32b5442dce 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java @@ -21,7 +21,7 @@ public class FakeClassnameTestController { **/ /* - public ResponseContext testClassname(RequestContext request , Client client) { + public ResponseContext testClassname(RequestContext request , Client body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java index e069a8c9751b..30c90ea5c658 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java @@ -19,6 +19,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; +import org.openapitools.model.XmlItem; public class FakeController { @@ -28,6 +29,12 @@ public class FakeController { * Code allows you to implement logic incrementally, they are disabled. **/ + /* + public ResponseContext createXmlItem(RequestContext request , XmlItem xmlItem) { + return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); + } + */ + /* public ResponseContext fakeOuterBooleanSerialize(RequestContext request , Boolean body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); @@ -35,7 +42,7 @@ public ResponseContext fakeOuterBooleanSerialize(RequestContext request , Boolea */ /* - public ResponseContext fakeOuterCompositeSerialize(RequestContext request , OuterComposite outerComposite) { + public ResponseContext fakeOuterCompositeSerialize(RequestContext request , OuterComposite body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -53,19 +60,19 @@ public ResponseContext fakeOuterStringSerialize(RequestContext request , String */ /* - public ResponseContext testBodyWithFileSchema(RequestContext request , FileSchemaTestClass fileSchemaTestClass) { + public ResponseContext testBodyWithFileSchema(RequestContext request , FileSchemaTestClass body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext testBodyWithQueryParams(RequestContext request , String query, User user) { + public ResponseContext testBodyWithQueryParams(RequestContext request , String query, User body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext testClientModel(RequestContext request , Client client) { + public ResponseContext testClientModel(RequestContext request , Client body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -83,7 +90,13 @@ public ResponseContext testEnumParameters(RequestContext request , List */ /* - public ResponseContext testInlineAdditionalProperties(RequestContext request , Map requestBody) { + public ResponseContext testGroupParameters(RequestContext request , Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { + return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); + } + */ + + /* + public ResponseContext testInlineAdditionalProperties(RequestContext request , Map param) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -94,6 +107,12 @@ public ResponseContext testJsonFormData(RequestContext request , String param, S } */ + /* + public ResponseContext testQueryParameterCollectionFormat(RequestContext request , List pipe, List ioutil, List http, List url, List context) { + return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); + } + */ + /* public ResponseContext uploadFileWithRequiredFile(RequestContext request , Long petId, FormDataContentDisposition fileDetail, String additionalMetadata) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java index cd276a634870..4475ca1323a9 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java @@ -23,7 +23,7 @@ public class PetController { **/ /* - public ResponseContext addPet(RequestContext request , Pet pet) { + public ResponseContext addPet(RequestContext request , Pet body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -53,7 +53,7 @@ public ResponseContext getPetById(RequestContext request , Long petId) { */ /* - public ResponseContext updatePet(RequestContext request , Pet pet) { + public ResponseContext updatePet(RequestContext request , Pet body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java index f67f43a380c6..f77cc1110dd1 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java @@ -40,7 +40,7 @@ public ResponseContext getOrderById(RequestContext request , Long orderId) { */ /* - public ResponseContext placeOrder(RequestContext request , Order order) { + public ResponseContext placeOrder(RequestContext request , Order body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java index 21ce727c6283..01fd4b9873ac 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java @@ -22,19 +22,19 @@ public class UserController { **/ /* - public ResponseContext createUser(RequestContext request , User user) { + public ResponseContext createUser(RequestContext request , User body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext createUsersWithArrayInput(RequestContext request , List user) { + public ResponseContext createUsersWithArrayInput(RequestContext request , List body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext createUsersWithListInput(RequestContext request , List user) { + public ResponseContext createUsersWithListInput(RequestContext request , List body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -64,7 +64,7 @@ public ResponseContext logoutUser(RequestContext request ) { */ /* - public ResponseContext updateUser(RequestContext request , String username, User user) { + public ResponseContext updateUser(RequestContext request , String username, User body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml b/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml index 277114e852d3..0dbcb3868c6d 100644 --- a/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml @@ -32,7 +32,10 @@ paths: description: Pet object that needs to be added to the store required: true responses: - 405: + "200": + content: {} + description: successful operation + "405": content: {} description: Invalid input security: @@ -42,6 +45,7 @@ paths: summary: Add a new pet to the store tags: - pet + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json put: @@ -57,13 +61,16 @@ paths: description: Pet object that needs to be added to the store required: true responses: - 400: + "200": + content: {} + description: successful operation + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Pet not found - 405: + "405": content: {} description: Validation exception security: @@ -73,6 +80,7 @@ paths: summary: Update an existing pet tags: - pet + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /pet/findByStatus: @@ -96,7 +104,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -109,7 +117,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": content: {} description: Invalid status value security: @@ -123,7 +131,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -137,7 +146,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -150,7 +159,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": content: {} description: Invalid tag value security: @@ -177,7 +186,10 @@ paths: format: int64 type: integer responses: - 400: + "200": + content: {} + description: successful operation + "400": content: {} description: Invalid pet value security: @@ -200,7 +212,7 @@ paths: format: int64 type: integer responses: - 200: + "200": content: application/xml: schema: @@ -209,10 +221,10 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Pet not found security: @@ -243,7 +255,7 @@ paths: description: Updated status of the pet type: string responses: - 405: + "405": content: {} description: Invalid input security: @@ -279,7 +291,7 @@ paths: format: binary type: string responses: - 200: + "200": content: application/json: schema: @@ -299,7 +311,7 @@ paths: description: Returns a map of status codes to quantities operationId: getInventory responses: - 200: + "200": content: application/json: schema: @@ -325,7 +337,7 @@ paths: description: order placed for purchasing the pet required: true responses: - 200: + "200": content: application/xml: schema: @@ -334,17 +346,19 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": content: {} description: Invalid Order summary: Place an order for a pet tags: - store + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /store/order/{order_id}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted @@ -354,10 +368,10 @@ paths: schema: type: string responses: - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Order not found summary: Delete purchase order by ID @@ -365,7 +379,8 @@ paths: - store x-accepts: application/json get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched @@ -378,7 +393,7 @@ paths: minimum: 1 type: integer responses: - 200: + "200": content: application/xml: schema: @@ -387,10 +402,10 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Order not found summary: Find purchase order by ID @@ -415,6 +430,7 @@ paths: summary: Create user tags: - user + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /user/createWithArray: @@ -436,6 +452,7 @@ paths: summary: Creates list of users with given input array tags: - user + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /user/createWithList: @@ -457,6 +474,7 @@ paths: summary: Creates list of users with given input array tags: - user + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /user/login: @@ -476,7 +494,7 @@ paths: schema: type: string responses: - 200: + "200": content: application/xml: schema: @@ -496,7 +514,7 @@ paths: schema: format: date-time type: string - 400: + "400": content: {} description: Invalid username/password supplied summary: Logs user into the system @@ -526,10 +544,10 @@ paths: schema: type: string responses: - 400: + "400": content: {} description: Invalid username supplied - 404: + "404": content: {} description: User not found summary: Delete user @@ -546,7 +564,7 @@ paths: schema: type: string responses: - 200: + "200": content: application/xml: schema: @@ -555,10 +573,10 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - 400: + "400": content: {} description: Invalid username supplied - 404: + "404": content: {} description: User not found summary: Get user by user name @@ -583,15 +601,16 @@ paths: description: Updated user object required: true responses: - 400: + "400": content: {} description: Invalid user supplied - 404: + "404": content: {} description: User not found summary: Updated user tags: - user + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /fake_classname_test: @@ -606,7 +625,7 @@ paths: description: client model required: true responses: - 200: + "200": content: application/json: schema: @@ -617,9 +636,58 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + - description: String in group parameters + in: query + name: string_group + schema: + type: integer + - description: Boolean in group parameters + in: header + name: boolean_group + schema: + type: boolean + - description: Integer in group parameters + in: query + name: int64_group + schema: + format: int64 + type: integer + responses: + "400": + content: {} + description: Someting wrong + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: application/json get: description: To test enum parameters operationId: testEnumParameters @@ -711,10 +779,10 @@ paths: - (xyz) type: string responses: - 400: + "400": content: {} description: Invalid request - 404: + "404": content: {} description: Not found summary: To test enum parameters @@ -733,7 +801,7 @@ paths: description: client model required: true responses: - 200: + "200": content: application/json: schema: @@ -742,14 +810,15 @@ paths: summary: To test "client" model tags: - fake + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json post: - description: | + description: |- Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: content: @@ -758,6 +827,7 @@ paths: properties: integer: description: None + format: int32 maximum: 100 minimum: 10 type: integer @@ -827,19 +897,19 @@ paths: - pattern_without_delimiter required: true responses: - 400: + "400": content: {} description: Invalid username supplied - 404: + "404": content: {} description: User not found security: - http_basic_test: [] - summary: | + summary: |- Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake x-contentType: application/x-www-form-urlencoded @@ -856,7 +926,7 @@ paths: description: Input number as post body required: false responses: - 200: + "200": content: '*/*': schema: @@ -864,6 +934,7 @@ paths: description: Output number tags: - fake + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/outer/string: @@ -878,7 +949,7 @@ paths: description: Input string as post body required: false responses: - 200: + "200": content: '*/*': schema: @@ -886,6 +957,7 @@ paths: description: Output string tags: - fake + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/outer/boolean: @@ -900,7 +972,7 @@ paths: description: Input boolean as post body required: false responses: - 200: + "200": content: '*/*': schema: @@ -908,6 +980,7 @@ paths: description: Output boolean tags: - fake + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/outer/composite: @@ -922,7 +995,7 @@ paths: description: Input composite as post body required: false responses: - 200: + "200": content: '*/*': schema: @@ -930,6 +1003,7 @@ paths: description: Output composite tags: - fake + x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/jsonFormData: @@ -951,7 +1025,7 @@ paths: - param2 required: true responses: - 200: + "200": content: {} description: successful operation summary: test json serialization of form data @@ -972,12 +1046,13 @@ paths: description: request body required: true responses: - 200: + "200": content: {} description: successful operation summary: test inline additionalProperties tags: - fake + x-codegen-request-body-name: param x-contentType: application/json x-accepts: application/json /fake/body-with-query-params: @@ -996,17 +1071,54 @@ paths: $ref: '#/components/schemas/User' required: true responses: - 200: + "200": content: {} description: Success tags: - fake + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json + /fake/create_xml_item: + post: + description: this route creates an XmlItem + operationId: createXmlItem + requestBody: + content: + application/xml: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + description: XmlItem Body + required: true + responses: + "200": + content: {} + description: successful operation + summary: creates an XmlItem + tags: + - fake + x-codegen-request-body-name: XmlItem + x-contentType: application/xml + x-accepts: application/json /another-fake/dummy: patch: - description: To test special tags - operationId: test_special_tags + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags requestBody: content: application/json: @@ -1015,7 +1127,7 @@ paths: description: client model required: true responses: - 200: + "200": content: application/json: schema: @@ -1024,11 +1136,13 @@ paths: summary: To test special tags tags: - $another-fake? + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema named `File`. + description: For this test, the body for this request much reference a schema + named `File`. operationId: testBodyWithFileSchema requestBody: content: @@ -1037,13 +1151,68 @@ paths: $ref: '#/components/schemas/FileSchemaTestClass' required: true responses: - 200: + "200": content: {} description: Success tags: - fake + x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: {} + description: Success + tags: + - fake + x-accepts: application/json /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile @@ -1063,15 +1232,15 @@ paths: additionalMetadata: description: Additional data to pass to server type: string - file: + requiredFile: description: file to upload format: binary type: string required: - - file + - requiredFile required: true responses: - 200: + "200": content: application/json: schema: @@ -1088,16 +1257,53 @@ paths: x-accepts: application/json components: schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order Category: example: - name: name + name: default-name id: 6 properties: id: format: int64 type: integer name: + default: default-name type: string + required: + - name type: object xml: name: Category @@ -1135,45 +1341,72 @@ components: type: object xml: name: User - OuterNumber: - type: number - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - Capitalization: + Tag: + example: + name: name + id: 1 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 + id: + format: int64 + type: integer + name: type: string type: object - MixedPropertiesAndAdditionalPropertiesClass: + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available properties: - uuid: - format: uuid + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie type: string - dateTime: - format: date-time + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object + required: + - name + - photoUrls type: object + xml: + name: Pet ApiResponse: example: code: 0 @@ -1188,6 +1421,23 @@ components: message: type: string type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return Name: description: Model for testing model name same as property name properties: @@ -1200,7 +1450,7 @@ components: type: integer property: type: string - 123Number: + "123Number": readOnly: true type: integer required: @@ -1208,50 +1458,120 @@ components: type: object xml: name: Name - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - List: - example: - 123-list: 123-list + "200_response": + description: Model for testing model name starting with number properties: - 123-list: - type: string - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - 200_response: - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: + name: + format: int32 + type: integer + class: type: string type: object xml: name: Name - Client: - example: - client: client + ClassModel: + description: Model for testing model with "_class" property properties: - client: + _class: type: string type: object Dog: allOf: - $ref: '#/components/schemas/Animal' - - properties: - breed: - type: string - type: object + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + BigDecimal: + format: number + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string Enum_Test: properties: enum_string: @@ -1283,184 +1603,238 @@ components: required: - enum_string_required type: object - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order AdditionalPropertiesClass: properties: - map_property: + map_string: additionalProperties: type: string type: object - map_of_map_property: + map_number: + additionalProperties: + type: number + type: object + map_integer: + additionalProperties: + type: integer + type: object + map_boolean: + additionalProperties: + type: boolean + type: object + map_array_integer: + additionalProperties: + items: + type: integer + type: array + type: object + map_array_anytype: + additionalProperties: + items: + properties: {} + type: object + type: array + type: object + map_map_string: additionalProperties: additionalProperties: type: string type: object type: object + map_map_anytype: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + type: object + anytype_1: + properties: {} + type: object + anytype_2: + type: object + anytype_3: + properties: {} + type: object type: object - $special[model.name]: + AdditionalPropertiesString: + additionalProperties: + type: string properties: - $special[property.name]: - format: int64 - type: integer + name: + type: string type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words + AdditionalPropertiesInteger: + additionalProperties: + type: integer properties: - return: - format: int32 - type: integer + name: + type: string type: object - xml: - name: Return - ReadOnlyFirst: + AdditionalPropertiesNumber: + additionalProperties: + type: number properties: - bar: - readOnly: true + name: type: string - baz: + type: object + AdditionalPropertiesBoolean: + additionalProperties: + type: boolean + properties: + name: type: string type: object - ArrayOfArrayOfNumberOnly: + AdditionalPropertiesArray: + additionalProperties: + items: + properties: {} + type: object + type: array properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array + name: + type: string type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - ArrayTest: + AdditionalPropertiesObject: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array + name: + type: string type: object - OuterComposite: + AdditionalPropertiesAnyType: + additionalProperties: + properties: {} + type: object + properties: + name: + type: string + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: example: - my_string: my_string - my_number: 0.80082819046101150206595775671303272247314453125 - my_boolean: true + client: client properties: - my_number: - type: number - my_string: + client: type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body type: object - format_test: + ReadOnlyFirst: properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: - format: int32 - maximum: 2E+2 - minimum: 2E+1 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i + bar: + readOnly: true type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + baz: type: string - binary: - format: binary + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true type: string - date: - format: date + foo: + readOnly: true type: string - dateTime: - format: date-time + type: object + Capitalization: + properties: + smallCamel: type: string - uuid: - format: uuid + CapitalCamel: type: string - password: - format: password - maxLength: 64 - minLength: 10 + small_Snake: type: string - required: - - byte - - date - - number - - password + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array type: object EnumArrays: properties: @@ -1477,17 +1851,37 @@ components: type: string type: array type: object - OuterString: + OuterEnum: + enum: + - placed + - approved + - delivered type: string - ClassModel: - description: Model for testing model with "_class" property + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true properties: - _class: + my_number: + type: number + my_string: type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object + OuterNumber: + type: number + OuterString: + type: string OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object FileSchemaTestClass: example: file: @@ -1503,138 +1897,269 @@ components: $ref: '#/components/schemas/File' type: array type: object - Animal: - discriminator: - propertyName: className + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI properties: - className: - type: string - color: - default: red + sourceURI: + description: Test capitalization type: string - required: - - className - type: object - StringBooleanMap: - additionalProperties: - type: boolean - type: object - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - $ref: '#/components/schemas/StringBooleanMap' type: object - Tag: - example: - name: name - id: 1 + TypeHolderDefault: properties: - id: - format: int64 - type: integer - name: + string_item: + default: what type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item type: object - xml: - name: Tag - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - File: - example: - sourceURI: sourceURI + TypeHolderExample: properties: - sourceURI: - description: Test capitalization + string_item: + example: what type: string + number_item: + example: 1.234 + type: number + float_item: + example: 1.234 + format: float + type: number + integer_item: + example: -2 + type: integer + bool_item: + example: true + type: boolean + array_item: + example: + - 0 + - 1 + - 2 + - 3 + items: + type: integer + type: array + required: + - array_item + - bool_item + - float_item + - integer_item + - number_item + - string_item type: object - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available + XmlItem: properties: - id: - format: int64 + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string type: string - photoUrls: + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: items: - type: string + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item type: array xml: - name: photoUrl + name: xml_name_wrapped_array wrapped: true - tags: + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: items: - $ref: '#/components/schemas/Tag' + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn type: array xml: - name: tag + prefix: kl wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold + namespace_string: + example: string type: string - required: - - name - - photoUrls + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true type: object xml: - name: Pet - hasOnlyReadOnly: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: properties: - bar: - readOnly: true + breed: type: string - foo: - readOnly: true + Cat_allOf: + properties: + declawed: + type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars type: string - type: object securitySchemes: petstore_auth: flows: @@ -1644,9 +2169,6 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 - http_basic_test: - scheme: basic - type: http api_key: in: header name: api_key @@ -1655,3 +2177,6 @@ components: in: query name: api_key_query type: apiKey + http_basic_test: + scheme: basic + type: http diff --git a/samples/server/petstore/java-pkmst/.openapi-generator/VERSION b/samples/server/petstore/java-pkmst/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/server/petstore/java-pkmst/.openapi-generator/VERSION +++ b/samples/server/petstore/java-pkmst/.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/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java index 460fd505765c..5398a81085b0 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.3-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java index d797135e85e8..dd16463deff0 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.3-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java index 052d1e0ec067..4d1df4a55b88 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.3-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java index 508aacee714e..70ae62fe6d2a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java @@ -475,7 +475,7 @@ public Result testQueryParameterCollectionFormat() throws Exception { if (httpArray == null) { throw new IllegalArgumentException("'http' parameter is required"); } - List httpList = OpenAPIUtils.parametersToList("space", httpArray); + List httpList = OpenAPIUtils.parametersToList("ssv", httpArray); List http = new ArrayList(); for (String curParam : httpList) { if (!curParam.isEmpty()) { diff --git a/samples/server/petstore/java-undertow/.openapi-generator/VERSION b/samples/server/petstore/java-undertow/.openapi-generator/VERSION index 06b5019af3f4..bfbf77eb7fad 100644 --- a/samples/server/petstore/java-undertow/.openapi-generator/VERSION +++ b/samples/server/petstore/java-undertow/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java index 9d9d4b7f43b0..3b979d4d40a9 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java @@ -22,7 +22,7 @@ public class Pet { private Long id; - private Category category = null; + private Category category; private String name; private List photoUrls = new ArrayList(); private List tags = new ArrayList(); diff --git a/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json b/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json index 9bf88937dd77..1a863721712a 100644 --- a/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json +++ b/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json @@ -1,35 +1,32 @@ { "openapi" : "3.0.1", "info" : { - "title" : "OpenAPI Petstore", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "license" : { "name" : "Apache-2.0", "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" }, + "title" : "OpenAPI Petstore", "version" : "1.0.0" }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets" + "description" : "Everything about your Pets", + "name" : "pet" }, { - "name" : "store", - "description" : "Access to Petstore orders" + "description" : "Access to Petstore orders", + "name" : "store" }, { - "name" : "user", - "description" : "Operations about user" + "description" : "Operations about user", + "name" : "user" } ], "paths" : { "/pet" : { - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "operationId" : "updatePet", + "post" : { + "operationId" : "addPet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -42,35 +39,27 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Pet not found", - "content" : { } - }, "405" : { - "description" : "Validation exception", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Add a new pet to the store", + "tags" : [ "pet" ], "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "operationId" : "addPet", + "put" : { + "operationId" : "updatePet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -83,17 +72,28 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Pet not found" + }, "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Update an existing pet", + "tags" : [ "pet" ], "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" @@ -101,132 +101,160 @@ }, "/pet/findByStatus" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by status", "description" : "Multiple status values can be provided with comma separated strings", "operationId" : "findPetsByStatus", "parameters" : [ { - "name" : "status", - "in" : "query", "description" : "Status values that need to be considered for filter", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "status", + "required" : true, "schema" : { - "type" : "array", "items" : { - "type" : "string", "default" : "available", - "enum" : [ "available", "pending", "sold" ] - } - } + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid status value", - "content" : { } + "content" : { }, + "description" : "Invalid status value" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by status", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/findByTags" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", + "deprecated" : true, "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", "operationId" : "findPetsByTags", "parameters" : [ { - "name" : "tags", - "in" : "query", "description" : "Tags to filter by", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "tags", + "required" : true, "schema" : { - "type" : "array", "items" : { "type" : "string" - } - } + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid tag value", - "content" : { } + "content" : { }, + "description" : "Invalid tag value" } }, - "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by tags", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "delete" : { + "operationId" : "deletePet", + "parameters" : [ { + "in" : "header", + "name" : "api_key", + "schema" : { + "type" : "string" + } + }, { + "description" : "Pet id to delete", + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", "tags" : [ "pet" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "description" : "Returns a single pet", "operationId" : "getPetById", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to return", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -238,34 +266,35 @@ "$ref" : "#/components/schemas/Pet" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Find pet by ID", + "tags" : [ "pet" ], "x-accepts" : "application/json" }, "post" : { - "tags" : [ "pet" ], - "summary" : "Updates a pet in the store with form data", "operationId" : "updatePetWithForm", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet that needs to be updated", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -274,12 +303,12 @@ "schema" : { "properties" : { "name" : { - "type" : "string", - "description" : "Updated name of the pet" + "description" : "Updated name of the pet", + "type" : "string" }, "status" : { - "type" : "string", - "description" : "Updated status of the pet" + "description" : "Updated status of the pet", + "type" : "string" } } } @@ -288,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "tags" : [ "pet" ], - "summary" : "Deletes a pet", - "operationId" : "deletePet", - "parameters" : [ { - "name" : "api_key", - "in" : "header", - "schema" : { - "type" : "string" - } - }, { - "name" : "petId", - "in" : "path", - "description" : "Pet id to delete", - "required" : true, - "schema" : { - "type" : "integer", - "format" : "int64" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid pet value", - "content" : { } - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], + "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/pet/{petId}/uploadImage" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", "operationId" : "uploadFile", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to update", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -351,13 +349,13 @@ "schema" : { "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, "file" : { - "type" : "string", "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } } } @@ -366,58 +364,57 @@ }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "uploads an image", + "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/store/inventory" : { "get" : { - "tags" : [ "store" ], - "summary" : "Returns pet inventories by status", "description" : "Returns a map of status codes to quantities", "operationId" : "getInventory", "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { - "type" : "object", "additionalProperties" : { - "type" : "integer", - "format" : "int32" - } + "format" : "int32", + "type" : "integer" + }, + "type" : "object" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Returns pet inventories by status", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -425,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -441,39 +438,65 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid Order", - "content" : { } + "content" : { }, + "description" : "Invalid Order" } }, + "summary" : "Place an order for a pet", + "tags" : [ "store" ], "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/store/order/{orderId}" : { - "get" : { + "delete" : { + "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + "operationId" : "deleteOrder", + "parameters" : [ { + "description" : "ID of the order that needs to be deleted", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Delete purchase order by ID", "tags" : [ "store" ], - "summary" : "Find purchase order by ID", + "x-accepts" : "application/json" + }, + "get" : { "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", "operationId" : "getOrderById", "parameters" : [ { - "name" : "orderId", - "in" : "path", "description" : "ID of pet that needs to be fetched", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { + "format" : "int64", "maximum" : 5, "minimum" : 1, - "type" : "integer", - "format" : "int64" + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -485,54 +508,28 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Find purchase order by ID", "tags" : [ "store" ], - "summary" : "Delete purchase order by ID", - "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", - "operationId" : "deleteOrder", - "parameters" : [ { - "name" : "orderId", - "in" : "path", - "description" : "ID of the order that needs to be deleted", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Order not found", - "content" : { } - } - }, "x-accepts" : "application/json" } }, "/user" : { "post" : { - "tags" : [ "user" ], - "summary" : "Create user", "description" : "This can only be done by the logged in user.", "operationId" : "createUser", "requestBody" : { - "description" : "Created user object", "content" : { "*/*" : { "schema" : { @@ -540,14 +537,17 @@ } } }, + "description" : "Created user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Create user", + "tags" : [ "user" ], "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" @@ -555,29 +555,29 @@ }, "/user/createWithArray" : { "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", "operationId" : "createUsersWithArrayInput", "requestBody" : { - "description" : "List of user object", "content" : { "*/*" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/User" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" @@ -585,29 +585,29 @@ }, "/user/createWithList" : { "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", "operationId" : "createUsersWithListInput", "requestBody" : { - "description" : "List of user object", "content" : { "*/*" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/User" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" @@ -615,21 +615,19 @@ }, "/user/login" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", "operationId" : "loginUser", "parameters" : [ { - "name" : "username", - "in" : "query", "description" : "The user name for login", + "in" : "query", + "name" : "username", "required" : true, "schema" : { "type" : "string" } }, { - "name" : "password", - "in" : "query", "description" : "The password for login in clear text", + "in" : "query", + "name" : "password", "required" : true, "schema" : { "type" : "string" @@ -637,67 +635,93 @@ } ], "responses" : { "200" : { - "description" : "successful operation", - "headers" : { - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", + "content" : { + "application/xml" : { "schema" : { - "type" : "integer", - "format" : "int32" + "type" : "string" } }, - "X-Expires-After" : { - "description" : "date in UTC when toekn expires", + "application/json" : { "schema" : { - "type" : "string", - "format" : "date-time" + "type" : "string" } } }, - "content" : { - "application/xml" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", "schema" : { - "type" : "string" + "format" : "int32", + "type" : "integer" } }, - "application/json" : { + "X-Expires-After" : { + "description" : "date in UTC when toekn expires", "schema" : { + "format" : "date-time", "type" : "string" } } } }, "400" : { - "description" : "Invalid username/password supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username/password supplied" } }, + "summary" : "Logs user into the system", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/logout" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", "operationId" : "logoutUser", "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Logs out current logged in user session", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "delete" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "description" : "The name that needs to be deleted", + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid username supplied" + }, + "404" : { + "content" : { }, + "description" : "User not found" + } + }, + "summary" : "Delete user", "tags" : [ "user" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "operationId" : "getUserByName", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing.", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" @@ -705,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -717,35 +740,35 @@ "$ref" : "#/components/schemas/User" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid username supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, + "summary" : "Get user by user name", + "tags" : [ "user" ], "x-accepts" : "application/json" }, "put" : { - "tags" : [ "user" ], - "summary" : "Updated user", "description" : "This can only be done by the logged in user.", "operationId" : "updateUser", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "name that need to be deleted", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { - "description" : "Updated user object", "content" : { "*/*" : { "schema" : { @@ -753,123 +776,109 @@ } } }, + "description" : "Updated user object", "required" : true }, "responses" : { "400" : { - "description" : "Invalid user supplied", - "content" : { } + "content" : { }, + "description" : "Invalid user supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, + "summary" : "Updated user", + "tags" : [ "user" ], "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" - }, - "delete" : { - "tags" : [ "user" ], - "summary" : "Delete user", - "description" : "This can only be done by the logged in user.", - "operationId" : "deleteUser", - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "The name that needs to be deleted", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid username supplied", - "content" : { } - }, - "404" : { - "description" : "User not found", - "content" : { } - } - }, - "x-accepts" : "application/json" } } }, "components" : { "schemas" : { "Order" : { - "title" : "Pet Order", - "type" : "object", + "description" : "An order for a pets from the pet store", + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "petId" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "quantity" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "shipDate" : { - "type" : "string", - "format" : "date-time" + "format" : "date-time", + "type" : "string" }, "status" : { - "type" : "string", "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" }, "complete" : { - "type" : "boolean", - "default" : false + "default" : false, + "type" : "boolean" } }, - "description" : "An order for a pets from the pet store", - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "title" : "Pet category", - "type" : "object", + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A category for a pet", - "example" : { - "name" : "name", - "id" : 6 - }, + "title" : "Pet category", + "type" : "object", "xml" : { "name" : "Category" } }, "User" : { - "title" : "a User", - "type" : "object", + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "username" : { "type" : "string" @@ -890,118 +899,113 @@ "type" : "string" }, "userStatus" : { - "type" : "integer", "description" : "User Status", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, - "description" : "A User who is purchasing from the pet store", - "example" : { - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" - }, + "title" : "a User", + "type" : "object", "xml" : { "name" : "User" } }, "Tag" : { - "title" : "Pet Tag", - "type" : "object", + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "name" : { "type" : "string" } }, - "description" : "A tag for a pet", - "example" : { - "name" : "name", - "id" : 1 - }, + "title" : "Pet Tag", + "type" : "object", "xml" : { "name" : "Tag" } }, "Pet" : { - "title" : "a Pet", - "required" : [ "name", "photoUrls" ], - "type" : "object", + "description" : "A pet for sale in the pet store", + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "category" : { "$ref" : "#/components/schemas/Category" }, "name" : { - "type" : "string", - "example" : "doggie" + "example" : "doggie", + "type" : "string" }, "photoUrls" : { + "items" : { + "type" : "string" + }, "type" : "array", "xml" : { "name" : "photoUrl", "wrapped" : true - }, - "items" : { - "type" : "string" } }, "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, "type" : "array", "xml" : { "name" : "tag", "wrapped" : true - }, - "items" : { - "$ref" : "#/components/schemas/Tag" } }, "status" : { - "type" : "string", "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "type" : "string" } }, - "description" : "A pet for sale in the pet store", - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" - }, + "required" : [ "name", "photoUrls" ], + "title" : "a Pet", + "type" : "object", "xml" : { "name" : "Pet" } }, "ApiResponse" : { - "title" : "An uploaded response", - "type" : "object", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, "properties" : { "code" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "type" : { "type" : "string" @@ -1010,17 +1014,12 @@ "type" : "string" } }, - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - } + "title" : "An uploaded response", + "type" : "object" } }, "securitySchemes" : { "petstore_auth" : { - "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -1029,12 +1028,13 @@ "read:pets" : "read your pets" } } - } + }, + "type" : "oauth2" }, "api_key" : { - "type" : "apiKey", + "in" : "header", "name" : "api_key", - "in" : "header" + "type" : "apiKey" } } } diff --git a/samples/server/petstore/java-vertx-web/rx/.openapi-generator/VERSION b/samples/server/petstore/java-vertx-web/rx/.openapi-generator/VERSION index d168f1d8bdaa..bfbf77eb7fad 100644 --- a/samples/server/petstore/java-vertx-web/rx/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx-web/rx/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApi.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApi.java index e7b397dc8ff3..a54ab62fe113 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApi.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApi.java @@ -12,12 +12,12 @@ import java.util.Map; public interface PetApi { - Single> addPet(Pet pet); + Single> addPet(Pet pet); Single> deletePet(Long petId,String apiKey); Single>> findPetsByStatus(List status); Single>> findPetsByTags(List tags); Single> getPetById(Long petId); - Single> updatePet(Pet pet); + Single> updatePet(Pet pet); Single> updatePetWithForm(Long petId,String name,String status); Single> uploadFile(Long petId,String additionalMetadata,FileUpload file); } diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java index d39237914ce8..113bec1f45ec 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java @@ -15,7 +15,7 @@ // Implement this class public class PetApiImpl implements PetApi { - public Single> addPet(Pet pet) { + public Single> addPet(Pet pet) { return Single.error(new ApiException("Not Implemented").setStatusCode(501)); } @@ -35,7 +35,7 @@ public Single> getPetById(Long petId) { return Single.error(new ApiException("Not Implemented").setStatusCode(501)); } - public Single> updatePet(Pet pet) { + public Single> updatePet(Pet pet) { return Single.error(new ApiException("Not Implemented").setStatusCode(501)); } diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Category.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Category.java index b880122ba95c..992be98373dc 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Category.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Category.java @@ -7,7 +7,7 @@ /** * A category for a pet **/ -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class Category { private Long id; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject.java index c7a35a888b97..3f6b989ec374 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class InlineObject { private String name; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject1.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject1.java index 14268dda3c53..58d654e083fd 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject1.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject1.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.vertx.ext.web.FileUpload; -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class InlineObject1 { private String additionalMetadata; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/ModelApiResponse.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/ModelApiResponse.java index 0113640b4853..9c7fa0e9af3f 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/ModelApiResponse.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/ModelApiResponse.java @@ -7,7 +7,7 @@ /** * Describes the result of uploading an image resource **/ -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class ModelApiResponse { private Integer code; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Order.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Order.java index f9f5906416cf..24c854f5948a 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Order.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Order.java @@ -9,7 +9,7 @@ /** * An order for a pets from the pet store **/ -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class Order { private Long id; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Pet.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Pet.java index d4bf37886cd3..f53e6d08e824 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Pet.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Pet.java @@ -12,7 +12,7 @@ /** * A pet for sale in the pet store **/ -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class Pet { private Long id; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Tag.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Tag.java index 46ee7f830ad1..bad53e0107e7 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Tag.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Tag.java @@ -7,7 +7,7 @@ /** * A tag for a pet **/ -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class Tag { private Long id; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/User.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/User.java index 0f9fcdfd4e87..989b3bca5568 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/User.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/User.java @@ -7,7 +7,7 @@ /** * A User who is purchasing from the pet store **/ -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class User { private Long id; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/resources/openapi.yaml b/samples/server/petstore/java-vertx-web/rx/src/main/resources/openapi.yaml index c35045135928..6d8ebba598bf 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/resources/openapi.yaml +++ b/samples/server/petstore/java-vertx-web/rx/src/main/resources/openapi.yaml @@ -26,7 +26,16 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - 405: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "405": description: Invalid input security: - petstore_auth: @@ -42,11 +51,20 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - 400: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": description: Invalid ID supplied - 404: + "404": description: Pet not found - 405: + "405": description: Validation exception security: - petstore_auth: @@ -78,7 +96,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -91,7 +109,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": description: Invalid status value security: - petstore_auth: @@ -118,7 +136,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -131,7 +149,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": description: Invalid tag value security: - petstore_auth: @@ -161,7 +179,7 @@ paths: type: integer style: simple responses: - 400: + "400": description: Invalid pet value security: - petstore_auth: @@ -185,7 +203,7 @@ paths: type: integer style: simple responses: - 200: + "200": content: application/xml: schema: @@ -194,9 +212,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: [] @@ -230,7 +248,7 @@ paths: type: string type: object responses: - 405: + "405": description: Invalid input security: - petstore_auth: @@ -269,7 +287,7 @@ paths: type: string type: object responses: - 200: + "200": content: application/json: schema: @@ -289,7 +307,7 @@ paths: description: Returns a map of status codes to quantities operationId: getInventory responses: - 200: + "200": content: application/json: schema: @@ -315,7 +333,7 @@ paths: description: order placed for purchasing the pet required: true responses: - 200: + "200": content: application/xml: schema: @@ -324,7 +342,7 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": description: Invalid Order summary: Place an order for a pet tags: @@ -346,9 +364,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: @@ -371,7 +389,7 @@ paths: type: integer style: simple responses: - 200: + "200": content: application/xml: schema: @@ -380,9 +398,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: @@ -461,7 +479,7 @@ paths: type: string style: form responses: - 200: + "200": content: application/xml: schema: @@ -493,7 +511,7 @@ paths: format: date-time type: string style: simple - 400: + "400": description: Invalid username/password supplied summary: Logs user into the system tags: @@ -525,9 +543,9 @@ paths: type: string style: simple responses: - 400: + "400": description: Invalid username supplied - 404: + "404": description: User not found security: - auth_cookie: [] @@ -547,7 +565,7 @@ paths: type: string style: simple responses: - 200: + "200": content: application/xml: schema: @@ -556,9 +574,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: @@ -584,9 +602,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/server/petstore/java-vertx/async/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/async/.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/server/petstore/java-vertx/rx/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/rx/.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/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION index afa636560641..bfbf77eb7fad 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java index 34d3f595cbdd..4d49b7da4475 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java @@ -73,7 +73,7 @@ public interface FakeApi { @POST @Path("/fake/outer/number") - @Consumes({ "application/json" }) + @Consumes({ "text/plain" }) @Produces({ "*/*" }) @ApiOperation(value = "", tags={ "fake", }) @ApiResponses(value = { @@ -121,15 +121,15 @@ public interface FakeApi { public Client testClientModel(@Valid Client 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 假端點 偽のエンドポイント 가짜 엔드 포인트 * */ @POST @Path("/fake") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ "fake", }) + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -182,9 +182,16 @@ public interface FakeApi { @GET @Path("/fake/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "test json serialization of form data", tags={ "fake" }) + @ApiOperation(value = "test json serialization of form data", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void testJsonFormData(@Multipart(value = "param") String param, @Multipart(value = "param2") String param2); + + @PUT + @Path("/fake/test-query-paramters") + @ApiOperation(value = "", tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + public void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe, @QueryParam("ioutil") @NotNull List ioutil, @QueryParam("http") @NotNull List http, @QueryParam("url") @NotNull List url, @QueryParam("context") @NotNull List context); } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 8d1b429f421a..f17083be06cc 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesAnyType extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 067459cbce6a..8c0fbc0652f0 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesArray extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index c4a6acccab76..6fff7947b819 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesBoolean extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 467dd334dd11..01b883e40433 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesClass { @ApiModelProperty(value = "") @@ -51,15 +52,15 @@ public class AdditionalPropertiesClass { @ApiModelProperty(value = "") @Valid - private Object anytype1 = null; + private Object anytype1; @ApiModelProperty(value = "") @Valid - private Object anytype2 = null; + private Object anytype2; @ApiModelProperty(value = "") @Valid - private Object anytype3 = null; + private Object anytype3; /** * Get mapString * @return mapString diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 9791c19d3e1d..83e8a3130dc6 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesInteger extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index c98d535e07ee..3959c6a0d73f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesNumber extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index 949eec2955cf..efbae205e250 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesObject extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index cdc65a2c3a49..91537d4689d3 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AdditionalPropertiesString extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java index 1da3838e1940..b0fab9fb5487 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java @@ -20,7 +20,9 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) + public class Animal { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java index c418106a5244..019440823ae2 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class AnimalFarm extends ArrayList { @Override diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index b30ac2cddbaf..0593a095489b 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ArrayOfArrayOfNumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 89edc0079e7f..ce65055a7f20 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ArrayOfNumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java index 88d5c73521d8..b8781d69cb4a 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ArrayTest { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java index 899f4b5e5d72..74fbb2eb6928 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Capitalization { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java index 83b49a63e37b..9a9a80e5c670 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java @@ -1,6 +1,7 @@ package org.openapitools.model; import org.openapitools.model.Animal; +import org.openapitools.model.CatAllOf; import javax.validation.constraints.*; import javax.validation.Valid; @@ -15,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Cat extends Animal { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java index c7bfb3b253e3..d210c55b9e5e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Category { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java index 105ecc2e7caf..7e8fb51d09fb 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java @@ -20,6 +20,7 @@ * Model for testing model with \"_class\" property */ @ApiModel(description="Model for testing model with \"_class\" property") + public class ClassModel { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java index dc7323ea4141..ce2f2f0d93b1 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Client { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java index e9d8e2ba5416..01b3ec86bb73 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java @@ -1,6 +1,7 @@ package org.openapitools.model; import org.openapitools.model.Animal; +import org.openapitools.model.DogAllOf; import javax.validation.constraints.*; import javax.validation.Valid; @@ -15,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Dog extends Animal { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java index 2104f50c0723..42b40db73f3e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class EnumArrays { @XmlType(name="JustSymbolEnum") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java index a8cce324ae65..6b1538b66a6b 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class EnumTest { @XmlType(name="EnumStringEnum") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 8d3da8aa0336..f337973b30f6 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,11 +16,12 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class FileSchemaTestClass { @ApiModelProperty(value = "") @Valid - private java.io.File file = null; + private java.io.File file; @ApiModelProperty(value = "") @Valid diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java index c354e724d590..b75f5241ee78 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class FormatTest { @ApiModelProperty(value = "") @@ -62,6 +63,9 @@ public class FormatTest { @ApiModelProperty(required = true, value = "") private String password; + + @ApiModelProperty(value = "") + private BigDecimal bigDecimal; /** * Get integer * minimum: 10 @@ -388,6 +392,30 @@ public FormatTest password(String password) { return this; } + /** + * Get bigDecimal + * @return bigDecimal + */ + @JsonProperty("BigDecimal") + public BigDecimal getBigDecimal() { + return bigDecimal; + } + + /** + * Sets the bigDecimal property. + */ + public void setBigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + } + + /** + * Sets the bigDecimal property. + */ + public FormatTest bigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + return this; + } + @Override public String toString() { @@ -407,6 +435,7 @@ public String toString() { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index e615164235c8..3c7f368696d6 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class HasOnlyReadOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java index 8714ac4adadd..e97b3da4a870 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class MapTest { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index f8323b7e7667..892306b389f8 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class MixedPropertiesAndAdditionalPropertiesClass { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java index 8bda567b99b7..d4a36c37f370 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java @@ -20,6 +20,7 @@ * Model for testing model name starting with number */ @ApiModel(description="Model for testing model name starting with number") + public class Model200Response { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java index 3f24ce9a87c2..b3f9be6ca8ef 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ModelApiResponse { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java index a339f3b086a2..2a7cb4552345 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java @@ -20,6 +20,7 @@ * Model for testing reserved words */ @ApiModel(description="Model for testing reserved words") + public class ModelReturn { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java index e8bf282ad11f..341dd203a69f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java @@ -20,6 +20,7 @@ * Model for testing model name same as property name */ @ApiModel(description="Model for testing model name same as property name") + public class Name { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java index 59b9db7ff8d5..1204458a9b10 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class NumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java index 09d6b24775ad..03954f7ba6ea 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Order { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java index bdc1aaca2f7e..2274591cee4f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class OuterComposite { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java index ea553b6b5592..67d0d6fd7012 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Pet { @ApiModelProperty(value = "") @@ -25,7 +26,7 @@ public class Pet { @ApiModelProperty(value = "") @Valid - private Category category = null; + private Category category; @ApiModelProperty(example = "doggie", required = true, value = "") private String name; diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index f265ecabd172..3626bcf31a68 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class ReadOnlyFirst { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java index 97b4ab49274e..e072c1d8c314 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class SpecialModelName { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java index 595b94064d3f..2d07ee91d333 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class StringBooleanMap extends HashMap { @Override diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java index 3c1cc5afe270..e65e4f5cfa62 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class Tag { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 54f512a9a845..62e2db250a88 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class TypeHolderDefault { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java index a94ba528deb1..1cdfe3a90478 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class TypeHolderExample { @ApiModelProperty(example = "what", required = true, value = "") @@ -26,6 +27,9 @@ public class TypeHolderExample { @Valid private BigDecimal numberItem; + @ApiModelProperty(example = "1.234", required = true, value = "") + private Float floatItem; + @ApiModelProperty(example = "-2", required = true, value = "") private Integer integerItem; @@ -84,6 +88,31 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { return this; } + /** + * Get floatItem + * @return floatItem + */ + @JsonProperty("float_item") + @NotNull + public Float getFloatItem() { + return floatItem; + } + + /** + * Sets the floatItem property. + */ + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + /** + * Sets the floatItem property. + */ + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + /** * Get integerItem * @return integerItem @@ -175,6 +204,7 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java index 232586cec731..5005cb8b4856 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java @@ -14,6 +14,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class User { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java index 5f5af932236e..4d5b2c85b602 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; + public class XmlItem { @ApiModelProperty(example = "string", value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index 6ebd879ad571..61c4946e3682 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -35,7 +35,7 @@ public class AnotherFakeApiServiceImpl implements AnotherFakeApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/david.biesack/dev/tools/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/AnotherFakeApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 2d987e5a1cd1..00267c75c319 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -43,7 +43,7 @@ public class FakeApiServiceImpl implements FakeApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/david.biesack/dev/tools/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/FakeApi"); } catch (CacheException e) { e.printStackTrace(); @@ -128,9 +128,9 @@ public Client testClientModel(Client 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 假端點 偽のエンドポイント 가짜 엔드 포인트 * */ @Override @@ -178,4 +178,9 @@ public void testJsonFormData(String param, String param2) { } + @Override + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) { + + } + } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java index 4440d69a1ea3..8f251a6af319 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -35,7 +35,7 @@ public class FakeClassnameTags123ApiServiceImpl implements FakeClassnameTags123A { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/david.biesack/dev/tools/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/FakeClassnameTags123Api"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 19dbdf663104..96e1ca669d4e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -38,7 +38,7 @@ public class PetApiServiceImpl implements PetApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/david.biesack/dev/tools/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/PetApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java index 3de4afe148ea..567d58d50550 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java @@ -35,7 +35,7 @@ public class StoreApiServiceImpl implements StoreApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/david.biesack/dev/tools/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/StoreApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 0d97bd614bb1..7f572ff4f820 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -35,7 +35,7 @@ public class UserApiServiceImpl implements UserApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/Users/david.biesack/dev/tools/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/UserApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json b/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json index e32a76dd3ff1..b21cfe16b887 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json @@ -79,7 +79,7 @@ } }, "testEndpointParameters" : { - "_double" : 91.68589154730602421612164906388358076583244837820529937744140625, + "_double" : 91.68589154730603, "patternWithoutDelimiter" : "^K᫢", "_byte" : "VA==", "integer" : 79, @@ -118,6 +118,13 @@ "testJsonFormData" : { "param" : "Gfe588Q6", "param2" : "QBx28IQ" + }, + "testQueryParameterCollectionFormat" : { + "pipe" : [ "pI1PMNEN" ], + "ioutil" : [ "x0M7w" ], + "http" : [ "Zz22JqF82y8A" ], + "url" : [ "Cs9OA" ], + "context" : [ "WoE87j" ] } }, "FakeClassnameTags123Api" : { diff --git a/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json b/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json index f368ad41cfc0..8f15d268abd5 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json +++ b/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json @@ -59,6 +59,23 @@ "param" : { "testItemCount" : 1 } + }, + "testQueryParameterCollectionFormat" : { + "pipe" : { + "testItemCount" : 1 + }, + "ioutil" : { + "testItemCount" : 1 + }, + "http" : { + "testItemCount" : 1 + }, + "url" : { + "testItemCount" : 1 + }, + "context" : { + "testItemCount" : 1 + } } }, "PetApi" : { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION index 6d94c9c2e12a..bfbf77eb7fad 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/AnotherFakeApi.java index d72eaf4a3932..b9c2317cb327 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -24,5 +24,5 @@ public interface AnotherFakeApi { @ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", tags={ "$another-fake?" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Response call123testSpecialTags(@Valid Client client); + Response call123testSpecialTags(@Valid Client body); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java index fed7bbc7f69b..c308bb68a1ea 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java @@ -10,6 +10,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; +import org.openapitools.model.XmlItem; import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -26,6 +27,14 @@ @Api(description = "the fake API") public interface FakeApi { + @POST + @Path("/create_xml_item") + @Consumes({ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }) + @ApiOperation(value = "creates an XmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + Response createXmlItem(@Valid XmlItem xmlItem); + @POST @Path("/outer/boolean") @Produces({ "*/*" }) @@ -40,7 +49,7 @@ public interface FakeApi { @ApiOperation(value = "", notes = "Test serialization of object with outer number type", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - Response fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite); + Response fakeOuterCompositeSerialize(@Valid OuterComposite body); @POST @Path("/outer/number") @@ -64,7 +73,7 @@ public interface FakeApi { @ApiOperation(value = "", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - Response testBodyWithFileSchema(@Valid FileSchemaTestClass fileSchemaTestClass); + Response testBodyWithFileSchema(@Valid FileSchemaTestClass body); @PUT @Path("/body-with-query-params") @@ -72,7 +81,7 @@ public interface FakeApi { @ApiOperation(value = "", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid User user); + Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid User body); @PATCH @Consumes({ "application/json" }) @@ -80,11 +89,11 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Response testClientModel(@Valid Client client); + Response testClientModel(@Valid Client body); @POST @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -98,7 +107,13 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - Response testEnumParameters(@HeaderParam("enum_header_string_array") @DefaultValue("new ArrayList()") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @DefaultValue("new ArrayList()") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString); + Response testEnumParameters(@HeaderParam("enum_header_string_array") @DefaultValue("new ArrayList()") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString); + + @DELETE + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) + Response testGroupParameters(@QueryParam("required_string_group") @NotNull @ApiParam("Required String in group parameters") Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull @ApiParam("Required Boolean in group parameters") Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull @ApiParam("Required Integer in group parameters") Long requiredInt64Group,@QueryParam("string_group") @ApiParam("String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @ApiParam("Integer in group parameters") Long int64Group); @POST @Path("/inline-additionalProperties") @@ -106,7 +121,7 @@ public interface FakeApi { @ApiOperation(value = "test inline additionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response testInlineAdditionalProperties(@Valid Map requestBody); + Response testInlineAdditionalProperties(@Valid Map param); @GET @Path("/jsonFormData") @@ -116,6 +131,13 @@ public interface FakeApi { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) Response testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2); + @PUT + @Path("/test-query-paramters") + @ApiOperation(value = "", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success", response = Void.class) }) + Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context); + @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 4e7829ee210d..73e623e549e0 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -25,5 +25,5 @@ public interface FakeClassnameTestApi { }, tags={ "fake_classname_tags 123#$%^" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Response testClassname(@Valid Client client); + Response testClassname(@Valid Client body); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java index db4be50f07b9..f186a66d1a31 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java @@ -28,8 +28,9 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - Response addPet(@Valid Pet pet); + Response addPet(@Valid Pet body); @DELETE @Path("/{petId}") @@ -40,8 +41,9 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); + Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); @GET @Path("/findByStatus") @@ -55,7 +57,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value", response = Void.class, responseContainer = "List") }) - Response findPetsByStatus(@QueryParam("status") @NotNull @DefaultValue("new ArrayList()") @ApiParam("Status values that need to be considered for filter") List status); + Response findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status); @GET @Path("/findByTags") @@ -69,7 +71,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class, responseContainer = "List") }) - Response findPetsByTags(@QueryParam("tags") @NotNull @DefaultValue("new ArrayList()") @ApiParam("Tags to filter by") List tags); + Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags); @GET @Path("/{petId}") @@ -92,10 +94,11 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - Response updatePet(@Valid Pet pet); + Response updatePet(@Valid Pet body); @POST @Path("/{petId}") diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/StoreApi.java index 2712d44cc786..802979265c27 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/StoreApi.java @@ -53,5 +53,5 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - Response placeOrder(@Valid Order order); + Response placeOrder(@Valid Order body); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java index d239142bf3cb..7848c218f5ee 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java @@ -22,21 +22,21 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response createUser(@Valid User user); + Response createUser(@Valid User body); @POST @Path("/createWithArray") @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response createUsersWithArrayInput(@Valid List user); + Response createUsersWithArrayInput(@Valid List body); @POST @Path("/createWithList") @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response createUsersWithListInput(@Valid List user); + Response createUsersWithListInput(@Valid List body); @DELETE @Path("/{username}") @@ -78,5 +78,5 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User user); + Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User body); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 58abe9915cb2..c70f3d5171d5 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -2,6 +2,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -19,41 +20,203 @@ public class AdditionalPropertiesClass implements Serializable { - private @Valid Map mapProperty = new HashMap(); - private @Valid Map> mapOfMapProperty = new HashMap>(); + private @Valid Map mapString = new HashMap(); + private @Valid Map mapNumber = new HashMap(); + private @Valid Map mapInteger = new HashMap(); + private @Valid Map mapBoolean = new HashMap(); + private @Valid Map> mapArrayInteger = new HashMap>(); + private @Valid Map> mapArrayAnytype = new HashMap>(); + private @Valid Map> mapMapString = new HashMap>(); + private @Valid Map> mapMapAnytype = new HashMap>(); + private @Valid Object anytype1; + private @Valid Object anytype2; + private @Valid Object anytype3; /** **/ - public AdditionalPropertiesClass mapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_property") - public Map getMapProperty() { - return mapProperty; + @JsonProperty("map_string") + public Map getMapString() { + return mapString; } - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public void setMapString(Map mapString) { + this.mapString = mapString; } /** **/ - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_of_map_property") - public Map> getMapOfMapProperty() { - return mapOfMapProperty; + @JsonProperty("map_number") + public Map getMapNumber() { + return mapNumber; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public void setMapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + } + + /** + **/ + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_integer") + public Map getMapInteger() { + return mapInteger; + } + public void setMapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + } + + /** + **/ + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_boolean") + public Map getMapBoolean() { + return mapBoolean; + } + public void setMapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + } + + /** + **/ + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_array_integer") + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + public void setMapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + } + + /** + **/ + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_array_anytype") + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + public void setMapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + } + + /** + **/ + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_map_string") + public Map> getMapMapString() { + return mapMapString; + } + public void setMapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + } + + /** + **/ + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("map_map_anytype") + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + /** + **/ + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("anytype_1") + public Object getAnytype1() { + return anytype1; + } + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } + + /** + **/ + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("anytype_2") + public Object getAnytype2() { + return anytype2; + } + public void setAnytype2(Object anytype2) { + this.anytype2 = anytype2; + } + + /** + **/ + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("anytype_3") + public Object getAnytype3() { + return anytype3; + } + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; } @@ -66,13 +229,22 @@ public boolean equals(java.lang.Object o) { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && + Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && + Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && + Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && + Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && + Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && + Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && + Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } @Override public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } @Override @@ -80,8 +252,17 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); + sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); + sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); + sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); + sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); + sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); + sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); + sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); + sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java index 8b2e9658341d..43bfbb7fd24d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java @@ -14,6 +14,12 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), +}) public class Animal implements Serializable { @@ -66,8 +72,8 @@ public boolean equals(java.lang.Object o) { return false; } Animal animal = (Animal) o; - return Objects.equals(className, animal.className) && - Objects.equals(color, animal.color); + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 43d65d72f381..cc9abca8a2a8 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -48,7 +48,7 @@ public boolean equals(java.lang.Object o) { return false; } ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index f29bd99493ae..40acdceef6a3 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -48,7 +48,7 @@ public boolean equals(java.lang.Object o) { return false; } ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(arrayNumber, arrayOfNumberOnly.arrayNumber); + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java index 249f75701bef..bd3241465564 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java @@ -84,9 +84,9 @@ public boolean equals(java.lang.Object o) { return false; } ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(arrayOfString, arrayTest.arrayOfString) && - Objects.equals(arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(arrayArrayOfModel, arrayTest.arrayArrayOfModel); + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java index 5ca325b2667b..9c9d8a8f4255 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java @@ -136,12 +136,12 @@ public boolean equals(java.lang.Object o) { return false; } Capitalization capitalization = (Capitalization) o; - return Objects.equals(smallCamel, capitalization.smallCamel) && - Objects.equals(capitalCamel, capitalization.capitalCamel) && - Objects.equals(smallSnake, capitalization.smallSnake) && - Objects.equals(capitalSnake, capitalization.capitalSnake) && - Objects.equals(scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(ATT_NAME, capitalization.ATT_NAME); + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java index 9bfcfde280c2..12cfde8994ab 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java @@ -3,6 +3,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; +import org.openapitools.model.CatAllOf; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -46,12 +47,13 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(declawed, cat.declawed); + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed); + return Objects.hash(declawed, super.hashCode()); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java index 4c665566958b..fa0c47ddd86d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java @@ -17,7 +17,7 @@ public class Category implements Serializable { private @Valid Long id; - private @Valid String name; + private @Valid String name = "default-name"; /** **/ @@ -44,8 +44,9 @@ public Category name(String name) { } - @ApiModelProperty(value = "") + @ApiModelProperty(required = true, value = "") @JsonProperty("name") + @NotNull public String getName() { return name; } @@ -63,8 +64,8 @@ public boolean equals(java.lang.Object o) { return false; } Category category = (Category) o; - return Objects.equals(id, category.id) && - Objects.equals(name, category.name); + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java index 5f7e3d649ce9..19e12db64933 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Model for testing model with \"_class\" property **/ @@ -47,7 +48,7 @@ public boolean equals(java.lang.Object o) { return false; } ClassModel classModel = (ClassModel) o; - return Objects.equals(propertyClass, classModel.propertyClass); + return Objects.equals(this.propertyClass, classModel.propertyClass); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java index 92b6aed4de68..9703ba67fc95 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java @@ -45,7 +45,7 @@ public boolean equals(java.lang.Object o) { return false; } Client client = (Client) o; - return Objects.equals(client, client.client); + return Objects.equals(this.client, client.client); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java index d22452d2d879..685f46dcdd48 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java @@ -3,6 +3,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; +import org.openapitools.model.DogAllOf; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -46,12 +47,13 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(breed, dog.breed); + return Objects.equals(this.breed, dog.breed) && + super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed); + return Objects.hash(breed, super.hashCode()); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java index ea468a71fc02..9a422c1c5540 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java @@ -41,13 +41,13 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String v) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -75,13 +75,13 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String v) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -131,8 +131,8 @@ public boolean equals(java.lang.Object o) { return false; } EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(justSymbol, enumArrays.justSymbol) && - Objects.equals(arrayEnum, enumArrays.arrayEnum); + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumClass.java index ba341ac9168c..64c669177148 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumClass.java @@ -31,13 +31,13 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java index d3f415601893..7dc8942410a0 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java @@ -40,13 +40,13 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String v) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -74,13 +74,13 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String v) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -108,13 +108,13 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String v) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -142,18 +142,18 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String v) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private @Valid EnumNumberEnum enumNumber; - private @Valid OuterEnum outerEnum = null; + private @Valid OuterEnum outerEnum; /** **/ @@ -251,11 +251,11 @@ public boolean equals(java.lang.Object o) { return false; } EnumTest enumTest = (EnumTest) o; - return Objects.equals(enumString, enumTest.enumString) && - Objects.equals(enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(enumInteger, enumTest.enumInteger) && - Objects.equals(enumNumber, enumTest.enumNumber) && - Objects.equals(outerEnum, enumTest.outerEnum); + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 0ba22995c7a2..e97c11e0df28 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -18,7 +18,7 @@ public class FileSchemaTestClass implements Serializable { - private @Valid java.io.File file = null; + private @Valid java.io.File file; private @Valid List files = new ArrayList(); /** @@ -65,8 +65,8 @@ public boolean equals(java.lang.Object o) { return false; } FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(file, fileSchemaTestClass.file) && - Objects.equals(files, fileSchemaTestClass.files); + return Objects.equals(this.file, fileSchemaTestClass.file) && + Objects.equals(this.files, fileSchemaTestClass.files); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java index 800fe24ff924..7132d9908d61 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java @@ -34,6 +34,7 @@ public class FormatTest implements Serializable { private @Valid Date dateTime; private @Valid UUID uuid; private @Valid String password; + private @Valid BigDecimal bigDecimal; /** * minimum: 10 @@ -243,7 +244,7 @@ public FormatTest uuid(UUID uuid) { } - @ApiModelProperty(value = "") + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty("uuid") public UUID getUuid() { return uuid; @@ -270,6 +271,23 @@ public void setPassword(String password) { this.password = password; } + /** + **/ + public FormatTest bigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("BigDecimal") + public BigDecimal getBigDecimal() { + return bigDecimal; + } + public void setBigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + } + @Override public boolean equals(java.lang.Object o) { @@ -280,24 +298,25 @@ public boolean equals(java.lang.Object o) { return false; } FormatTest formatTest = (FormatTest) o; - return Objects.equals(integer, formatTest.integer) && - Objects.equals(int32, formatTest.int32) && - Objects.equals(int64, formatTest.int64) && - Objects.equals(number, formatTest.number) && - Objects.equals(_float, formatTest._float) && - Objects.equals(_double, formatTest._double) && - Objects.equals(string, formatTest.string) && - Objects.equals(_byte, formatTest._byte) && - Objects.equals(binary, formatTest.binary) && - Objects.equals(date, formatTest.date) && - Objects.equals(dateTime, formatTest.dateTime) && - Objects.equals(uuid, formatTest.uuid) && - Objects.equals(password, formatTest.password); + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.string, formatTest.string) && + Objects.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.bigDecimal, formatTest.bigDecimal); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); } @Override @@ -318,6 +337,7 @@ public String toString() { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 03cf3ef7aaaf..76898a7831bc 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -63,8 +63,8 @@ public boolean equals(java.lang.Object o) { return false; } HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(bar, hasOnlyReadOnly.bar) && - Objects.equals(foo, hasOnlyReadOnly.foo); + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java index d0e0137e2107..059f500d097f 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java @@ -5,7 +5,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.model.StringBooleanMap; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -44,19 +43,19 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String v) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } private @Valid Map mapOfEnumString = new HashMap(); private @Valid Map directMap = new HashMap(); - private @Valid StringBooleanMap indirectMap = null; + private @Valid Map indirectMap = new HashMap(); /** **/ @@ -111,7 +110,7 @@ public void setDirectMap(Map directMap) { /** **/ - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } @@ -119,10 +118,10 @@ public MapTest indirectMap(StringBooleanMap indirectMap) { @ApiModelProperty(value = "") @JsonProperty("indirect_map") - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } @@ -136,10 +135,10 @@ public boolean equals(java.lang.Object o) { return false; } MapTest mapTest = (MapTest) o; - return Objects.equals(mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(directMap, mapTest.directMap) && - Objects.equals(indirectMap, mapTest.indirectMap); + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index dba6f5f403ff..8467e42ead18 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -87,9 +87,9 @@ public boolean equals(java.lang.Object o) { return false; } MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(map, mixedPropertiesAndAdditionalPropertiesClass.map); + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java index d4122c4a2e1e..d330491d413e 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Model for testing model name starting with number **/ @@ -65,8 +66,8 @@ public boolean equals(java.lang.Object o) { return false; } Model200Response _200response = (Model200Response) o; - return Objects.equals(name, _200response.name) && - Objects.equals(propertyClass, _200response.propertyClass); + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java index ab53e3693652..3aeaa2e80a83 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -81,9 +81,9 @@ public boolean equals(java.lang.Object o) { return false; } ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(code, _apiResponse.code) && - Objects.equals(type, _apiResponse.type) && - Objects.equals(message, _apiResponse.message); + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java index 90f40a248f25..b8ccb56ccd5d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Model for testing reserved words **/ @@ -47,7 +48,7 @@ public boolean equals(java.lang.Object o) { return false; } ModelReturn _return = (ModelReturn) o; - return Objects.equals(_return, _return._return); + return Objects.equals(this._return, _return._return); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java index bab48c428e64..30f2f65ac65e 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + /** * Model for testing model name same as property name **/ @@ -102,10 +103,10 @@ public boolean equals(java.lang.Object o) { return false; } Name name = (Name) o; - return Objects.equals(name, name.name) && - Objects.equals(snakeCase, name.snakeCase) && - Objects.equals(property, name.property) && - Objects.equals(_123number, name._123number); + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java index 000db43f0918..b5ae07a3dfb0 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java @@ -46,7 +46,7 @@ public boolean equals(java.lang.Object o) { return false; } NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(justNumber, numberOnly.justNumber); + return Objects.equals(this.justNumber, numberOnly.justNumber); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java index dc35e75e0111..4c88bb4d6ad6 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java @@ -44,13 +44,13 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String v) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -170,12 +170,12 @@ public boolean equals(java.lang.Object o) { return false; } Order order = (Order) o; - return Objects.equals(id, order.id) && - Objects.equals(petId, order.petId) && - Objects.equals(quantity, order.quantity) && - Objects.equals(shipDate, order.shipDate) && - Objects.equals(status, order.status) && - Objects.equals(complete, order.complete); + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java index 9ae89e7a2856..14e7f71319ad 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java @@ -82,9 +82,9 @@ public boolean equals(java.lang.Object o) { return false; } OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(myNumber, outerComposite.myNumber) && - Objects.equals(myString, outerComposite.myString) && - Objects.equals(myBoolean, outerComposite.myBoolean); + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterEnum.java index f69d482a93d9..fbd86c9bdbe1 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterEnum.java @@ -31,13 +31,13 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java index 6c5f3319798c..6718025e6926 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java @@ -21,7 +21,7 @@ public class Pet implements Serializable { private @Valid Long id; - private @Valid Category category = null; + private @Valid Category category; private @Valid String name; private @Valid List photoUrls = new ArrayList(); private @Valid List tags = new ArrayList(); @@ -48,13 +48,13 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String v) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(v)) { + if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + v + "'"); + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -175,12 +175,12 @@ public boolean equals(java.lang.Object o) { return false; } Pet pet = (Pet) o; - return Objects.equals(id, pet.id) && - Objects.equals(category, pet.category) && - Objects.equals(name, pet.name) && - Objects.equals(photoUrls, pet.photoUrls) && - Objects.equals(tags, pet.tags) && - Objects.equals(status, pet.status); + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 031ee7cf9f12..27b680b98690 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -63,8 +63,8 @@ public boolean equals(java.lang.Object o) { return false; } ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(bar, readOnlyFirst.bar) && - Objects.equals(baz, readOnlyFirst.baz); + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java index 9d589d25a4b0..9e1984faaa05 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -45,7 +45,7 @@ public boolean equals(java.lang.Object o) { return false; } SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals($specialPropertyName, $specialModelName.$specialPropertyName); + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java index 15e81930db25..cec2b713130a 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java @@ -63,8 +63,8 @@ public boolean equals(java.lang.Object o) { return false; } Tag tag = (Tag) o; - return Objects.equals(id, tag.id) && - Objects.equals(name, tag.name); + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java index 2b3123ad16b0..2ab19c284a30 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java @@ -172,14 +172,14 @@ public boolean equals(java.lang.Object o) { return false; } User user = (User) o; - return Objects.equals(id, user.id) && - Objects.equals(username, user.username) && - Objects.equals(firstName, user.firstName) && - Objects.equals(lastName, user.lastName) && - Objects.equals(email, user.email) && - Objects.equals(password, user.password) && - Objects.equals(phone, user.phone) && - Objects.equals(userStatus, user.userStatus); + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml index d20a3573e5cb..f6f5c60294f7 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml @@ -32,7 +32,10 @@ paths: description: Pet object that needs to be added to the store required: true responses: - 405: + "200": + content: {} + description: successful operation + "405": content: {} description: Invalid input security: @@ -42,6 +45,9 @@ paths: summary: Add a new pet to the store tags: - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json x-tags: - tag: pet put: @@ -57,13 +63,16 @@ paths: description: Pet object that needs to be added to the store required: true responses: - 400: + "200": + content: {} + description: successful operation + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Pet not found - 405: + "405": content: {} description: Validation exception security: @@ -73,6 +82,9 @@ paths: summary: Update an existing pet tags: - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json x-tags: - tag: pet /pet/findByStatus: @@ -96,7 +108,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -109,7 +121,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": content: {} description: Invalid status value security: @@ -119,12 +131,14 @@ paths: summary: Finds Pets by status tags: - pet + x-accepts: application/json x-tags: - tag: pet /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -138,7 +152,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -151,7 +165,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": content: {} description: Invalid tag value security: @@ -161,6 +175,7 @@ paths: summary: Finds Pets by tags tags: - pet + x-accepts: application/json x-tags: - tag: pet /pet/{petId}: @@ -179,7 +194,10 @@ paths: format: int64 type: integer responses: - 400: + "200": + content: {} + description: successful operation + "400": content: {} description: Invalid pet value security: @@ -189,6 +207,7 @@ paths: summary: Deletes a pet tags: - pet + x-accepts: application/json x-tags: - tag: pet get: @@ -203,7 +222,7 @@ paths: format: int64 type: integer responses: - 200: + "200": content: application/xml: schema: @@ -212,10 +231,10 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Pet not found security: @@ -223,6 +242,7 @@ paths: summary: Find pet by ID tags: - pet + x-accepts: application/json x-tags: - tag: pet post: @@ -247,7 +267,7 @@ paths: description: Updated status of the pet type: string responses: - 405: + "405": content: {} description: Invalid input security: @@ -257,6 +277,8 @@ paths: summary: Updates a pet in the store with form data tags: - pet + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json x-tags: - tag: pet /pet/{petId}/uploadImage: @@ -283,7 +305,7 @@ paths: format: binary type: string responses: - 200: + "200": content: application/json: schema: @@ -296,6 +318,8 @@ paths: summary: uploads an image tags: - pet + x-contentType: multipart/form-data + x-accepts: application/json x-tags: - tag: pet /store/inventory: @@ -303,7 +327,7 @@ paths: description: Returns a map of status codes to quantities operationId: getInventory responses: - 200: + "200": content: application/json: schema: @@ -317,6 +341,7 @@ paths: summary: Returns pet inventories by status tags: - store + x-accepts: application/json x-tags: - tag: store /store/order: @@ -330,7 +355,7 @@ paths: description: order placed for purchasing the pet required: true responses: - 200: + "200": content: application/xml: schema: @@ -339,17 +364,21 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": content: {} description: Invalid Order summary: Place an order for a pet tags: - store + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json x-tags: - tag: store /store/order/{order_id}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted @@ -359,19 +388,21 @@ paths: schema: type: string responses: - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Order not found summary: Delete purchase order by ID tags: - store + x-accepts: application/json x-tags: - tag: store get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched @@ -384,7 +415,7 @@ paths: minimum: 1 type: integer responses: - 200: + "200": content: application/xml: schema: @@ -393,15 +424,16 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Order not found summary: Find purchase order by ID tags: - store + x-accepts: application/json x-tags: - tag: store /user: @@ -422,6 +454,9 @@ paths: summary: Create user tags: - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json x-tags: - tag: user /user/createWithArray: @@ -443,6 +478,9 @@ paths: summary: Creates list of users with given input array tags: - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json x-tags: - tag: user /user/createWithList: @@ -464,6 +502,9 @@ paths: summary: Creates list of users with given input array tags: - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json x-tags: - tag: user /user/login: @@ -483,7 +524,7 @@ paths: schema: type: string responses: - 200: + "200": content: application/xml: schema: @@ -503,12 +544,13 @@ paths: schema: format: date-time type: string - 400: + "400": content: {} description: Invalid username/password supplied summary: Logs user into the system tags: - user + x-accepts: application/json x-tags: - tag: user /user/logout: @@ -521,6 +563,7 @@ paths: summary: Logs out current logged in user session tags: - user + x-accepts: application/json x-tags: - tag: user /user/{username}: @@ -535,15 +578,16 @@ paths: schema: type: string responses: - 400: + "400": content: {} description: Invalid username supplied - 404: + "404": content: {} description: User not found summary: Delete user tags: - user + x-accepts: application/json x-tags: - tag: user get: @@ -556,7 +600,7 @@ paths: schema: type: string responses: - 200: + "200": content: application/xml: schema: @@ -565,15 +609,16 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - 400: + "400": content: {} description: Invalid username supplied - 404: + "404": content: {} description: User not found summary: Get user by user name tags: - user + x-accepts: application/json x-tags: - tag: user put: @@ -594,15 +639,18 @@ paths: description: Updated user object required: true responses: - 400: + "400": content: {} description: Invalid user supplied - 404: + "404": content: {} description: User not found summary: Updated user tags: - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json x-tags: - tag: user /fake_classname_test: @@ -617,7 +665,7 @@ paths: description: client model required: true responses: - 200: + "200": content: application/json: schema: @@ -628,9 +676,62 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json x-tags: - tag: fake_classname_tags 123#$%^ /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + - description: String in group parameters + in: query + name: string_group + schema: + type: integer + - description: Boolean in group parameters + in: header + name: boolean_group + schema: + type: boolean + - description: Integer in group parameters + in: query + name: int64_group + schema: + format: int64 + type: integer + responses: + "400": + content: {} + description: Someting wrong + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: application/json + x-tags: + - tag: fake get: description: To test enum parameters operationId: testEnumParameters @@ -722,15 +823,17 @@ paths: - (xyz) type: string responses: - 400: + "400": content: {} description: Invalid request - 404: + "404": content: {} description: Not found summary: To test enum parameters tags: - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json x-tags: - tag: fake patch: @@ -744,7 +847,7 @@ paths: description: client model required: true responses: - 200: + "200": content: application/json: schema: @@ -753,14 +856,17 @@ paths: summary: To test "client" model tags: - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json x-tags: - tag: fake post: - description: | + description: |- Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: content: @@ -769,6 +875,7 @@ paths: properties: integer: description: None + format: int32 maximum: 100 minimum: 10 type: integer @@ -838,21 +945,23 @@ paths: - pattern_without_delimiter required: true responses: - 400: + "400": content: {} description: Invalid username supplied - 404: + "404": content: {} description: User not found security: - http_basic_test: [] - summary: | + summary: |- Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json x-tags: - tag: fake /fake/outer/number: @@ -867,7 +976,7 @@ paths: description: Input number as post body required: false responses: - 200: + "200": content: '*/*': schema: @@ -875,6 +984,9 @@ paths: description: Output number tags: - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' x-tags: - tag: fake /fake/outer/string: @@ -889,7 +1001,7 @@ paths: description: Input string as post body required: false responses: - 200: + "200": content: '*/*': schema: @@ -897,6 +1009,9 @@ paths: description: Output string tags: - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' x-tags: - tag: fake /fake/outer/boolean: @@ -911,7 +1026,7 @@ paths: description: Input boolean as post body required: false responses: - 200: + "200": content: '*/*': schema: @@ -919,6 +1034,9 @@ paths: description: Output boolean tags: - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' x-tags: - tag: fake /fake/outer/composite: @@ -933,7 +1051,7 @@ paths: description: Input composite as post body required: false responses: - 200: + "200": content: '*/*': schema: @@ -941,6 +1059,9 @@ paths: description: Output composite tags: - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: @@ -962,12 +1083,14 @@ paths: - param2 required: true responses: - 200: + "200": content: {} description: successful operation summary: test json serialization of form data tags: - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json x-tags: - tag: fake /fake/inline-additionalProperties: @@ -983,12 +1106,15 @@ paths: description: request body required: true responses: - 200: + "200": content: {} description: successful operation summary: test inline additionalProperties tags: - fake + x-codegen-request-body-name: param + x-contentType: application/json + x-accepts: application/json x-tags: - tag: fake /fake/body-with-query-params: @@ -1007,11 +1133,52 @@ paths: $ref: '#/components/schemas/User' required: true responses: - 200: + "200": content: {} description: Success tags: - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + /fake/create_xml_item: + post: + description: this route creates an XmlItem + operationId: createXmlItem + requestBody: + content: + application/xml: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + description: XmlItem Body + required: true + responses: + "200": + content: {} + description: successful operation + summary: creates an XmlItem + tags: + - fake + x-codegen-request-body-name: XmlItem + x-contentType: application/xml + x-accepts: application/json x-tags: - tag: fake /another-fake/dummy: @@ -1026,7 +1193,7 @@ paths: description: client model required: true responses: - 200: + "200": content: application/json: schema: @@ -1035,11 +1202,15 @@ paths: summary: To test special tags tags: - $another-fake? + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json x-tags: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema named `File`. + description: For this test, the body for this request much reference a schema + named `File`. operationId: testBodyWithFileSchema requestBody: content: @@ -1048,11 +1219,70 @@ paths: $ref: '#/components/schemas/FileSchemaTestClass' required: true responses: - 200: + "200": + content: {} + description: Success + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + x-tags: + - tag: fake + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": content: {} description: Success tags: - fake + x-accepts: application/json x-tags: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: @@ -1082,7 +1312,7 @@ paths: - requiredFile required: true responses: - 200: + "200": content: application/json: schema: @@ -1095,20 +1325,59 @@ paths: summary: uploads an image (required) tags: - pet + x-contentType: multipart/form-data + x-accepts: application/json x-tags: - tag: pet components: schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order Category: example: - name: name + name: default-name id: 6 properties: id: format: int64 type: integer name: + default: default-name type: string + required: + - name type: object xml: name: Category @@ -1146,45 +1415,72 @@ components: type: object xml: name: User - OuterNumber: - type: number - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - Capitalization: + Tag: + example: + name: name + id: 1 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 + id: + format: int64 + type: integer + name: type: string type: object - MixedPropertiesAndAdditionalPropertiesClass: + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available properties: - uuid: - format: uuid + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie type: string - dateTime: - format: date-time + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object + required: + - name + - photoUrls type: object + xml: + name: Pet ApiResponse: example: code: 0 @@ -1199,6 +1495,23 @@ components: message: type: string type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return Name: description: Model for testing model name same as property name properties: @@ -1211,7 +1524,7 @@ components: type: integer property: type: string - 123Number: + "123Number": readOnly: true type: integer required: @@ -1219,50 +1532,120 @@ components: type: object xml: name: Name - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - List: - example: - 123-list: 123-list + "200_response": + description: Model for testing model name starting with number properties: - 123-list: - type: string - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - 200_response: - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: + name: + format: int32 + type: integer + class: type: string type: object xml: name: Name - Client: - example: - client: client + ClassModel: + description: Model for testing model with "_class" property properties: - client: + _class: type: string type: object Dog: allOf: - $ref: '#/components/schemas/Animal' - - properties: - breed: - type: string - type: object + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + BigDecimal: + format: number + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string Enum_Test: properties: enum_string: @@ -1294,184 +1677,238 @@ components: required: - enum_string_required type: object - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order AdditionalPropertiesClass: properties: - map_property: + map_string: additionalProperties: type: string type: object - map_of_map_property: + map_number: + additionalProperties: + type: number + type: object + map_integer: + additionalProperties: + type: integer + type: object + map_boolean: + additionalProperties: + type: boolean + type: object + map_array_integer: + additionalProperties: + items: + type: integer + type: array + type: object + map_array_anytype: + additionalProperties: + items: + properties: {} + type: object + type: array + type: object + map_map_string: additionalProperties: additionalProperties: type: string type: object type: object + map_map_anytype: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + type: object + anytype_1: + properties: {} + type: object + anytype_2: + type: object + anytype_3: + properties: {} + type: object type: object - $special[model.name]: + AdditionalPropertiesString: + additionalProperties: + type: string properties: - $special[property.name]: - format: int64 - type: integer + name: + type: string type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words + AdditionalPropertiesInteger: + additionalProperties: + type: integer properties: - return: - format: int32 - type: integer + name: + type: string type: object - xml: - name: Return - ReadOnlyFirst: + AdditionalPropertiesNumber: + additionalProperties: + type: number properties: - bar: - readOnly: true + name: type: string - baz: + type: object + AdditionalPropertiesBoolean: + additionalProperties: + type: boolean + properties: + name: type: string type: object - ArrayOfArrayOfNumberOnly: + AdditionalPropertiesArray: + additionalProperties: + items: + properties: {} + type: object + type: array properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array + name: + type: string type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - ArrayTest: + AdditionalPropertiesObject: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array + name: + type: string type: object - OuterComposite: + AdditionalPropertiesAnyType: + additionalProperties: + properties: {} + type: object + properties: + name: + type: string + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: example: - my_string: my_string - my_number: 0.80082819046101150206595775671303272247314453125 - my_boolean: true + client: client properties: - my_number: - type: number - my_string: + client: type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body type: object - format_test: + ReadOnlyFirst: properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: - format: int32 - maximum: 2E+2 - minimum: 2E+1 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i + bar: + readOnly: true type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + baz: type: string - binary: - format: binary + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true type: string - date: - format: date + foo: + readOnly: true type: string - dateTime: - format: date-time + type: object + Capitalization: + properties: + smallCamel: type: string - uuid: - format: uuid + CapitalCamel: type: string - password: - format: password - maxLength: 64 - minLength: 10 + small_Snake: type: string - required: - - byte - - date - - number - - password + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array type: object EnumArrays: properties: @@ -1488,17 +1925,37 @@ components: type: string type: array type: object - OuterString: + OuterEnum: + enum: + - placed + - approved + - delivered type: string - ClassModel: - description: Model for testing model with "_class" property + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true properties: - _class: + my_number: + type: number + my_string: type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object + OuterNumber: + type: number + OuterString: + type: string OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object FileSchemaTestClass: example: file: @@ -1514,68 +1971,6 @@ components: $ref: '#/components/schemas/File' type: array type: object - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - StringBooleanMap: - additionalProperties: - type: boolean - type: object - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - $ref: '#/components/schemas/StringBooleanMap' - type: object - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array File: description: Must be named `File` for test. example: @@ -1585,68 +1980,260 @@ components: description: Test capitalization type: string type: object - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available + TypeHolderDefault: properties: - id: - format: int64 + string_item: + default: what + type: string + number_item: + type: number + integer_item: type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + properties: + string_item: + example: what type: string - photoUrls: + number_item: + example: 1.234 + type: number + float_item: + example: 1.234 + format: float + type: number + integer_item: + example: -2 + type: integer + bool_item: + example: true + type: boolean + array_item: + example: + - 0 + - 1 + - 2 + - 3 items: - type: string + type: integer + type: array + required: + - array_item + - bool_item + - float_item + - integer_item + - number_item + - string_item + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer type: array xml: - name: photoUrl wrapped: true - tags: + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: items: - $ref: '#/components/schemas/Tag' + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item type: array xml: - name: tag + name: xml_name_wrapped_array wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold + prefix_string: + example: string type: string - required: - - name - - photoUrls + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true type: object xml: - name: Pet - hasOnlyReadOnly: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: properties: - bar: - readOnly: true + breed: type: string - foo: - readOnly: true + Cat_allOf: + properties: + declawed: + type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars type: string - type: object securitySchemes: petstore_auth: flows: @@ -1656,9 +2243,6 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 - http_basic_test: - scheme: basic - type: http api_key: in: header name: api_key @@ -1667,3 +2251,6 @@ components: in: query name: api_key_query type: apiKey + http_basic_test: + scheme: basic + type: http diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 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.3-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts b/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts index 26f4601e5705..49fe9400f70d 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile buildscript { repositories { jcenter() - mavenCentral() + maven { url = uri("https://repo1.maven.org/maven2") } } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.0.M3") @@ -15,7 +15,7 @@ version = "1.0.0" repositories { jcenter() - mavenCentral() + maven { url = uri("https://repo1.maven.org/maven2") } } tasks.withType { @@ -48,7 +48,7 @@ dependencies { } repositories { - mavenCentral() + maven { url = uri("https://repo1.maven.org/maven2") } maven { url = uri("https://repo.spring.io/snapshot") } maven { url = uri("https://repo.spring.io/milestone") } } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/Exceptions.kt index 4d8400902aa9..44190af7a019 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/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-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt index 74e95802723e..bc0b66d8aba2 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt @@ -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") var id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") var id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") var name: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") var name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index a121d4abe1d1..a73c2bacacef 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -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") var code: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") var code: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("type") var type: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") var type: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("message") var message: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") var message: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt index 5ed9ea534974..474fd5a82b2d 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt @@ -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") var id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") var id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("petId") var petId: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") var petId: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("quantity") var quantity: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") var quantity: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("shipDate") var shipDate: java.time.OffsetDateTime? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") var shipDate: java.time.OffsetDateTime? = null, - @ApiModelProperty(example = "null", value = "Order Status") - @JsonProperty("status") var status: Order.Status? = null, + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") var status: Order.Status? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("complete") var complete: kotlin.Boolean? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") var complete: kotlin.Boolean? = null ) { /** 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 5868cb23e3ff..7386590e96cf 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 @@ -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") var name: kotlin.String, + @get:NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") var name: kotlin.String, - @get:NotNull - @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("photoUrls") var photoUrls: kotlin.collections.List, + @get:NotNull + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") var photoUrls: kotlin.collections.List, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") var id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") var id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("category") var category: Category? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") var category: Category? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") var tags: kotlin.collections.List? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") var tags: kotlin.collections.List? = null, - @ApiModelProperty(example = "null", value = "pet status in the store") - @JsonProperty("status") var status: Pet.Status? = null + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") var status: Pet.Status? = null ) { /** diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt index 3997d00edbef..ffb1ee025666 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt @@ -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") var id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") var id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") var name: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") var name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt index 011d28b1cdb8..f9e666336daf 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt @@ -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") var id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") var id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("username") var username: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") var username: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("firstName") var firstName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") var firstName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("lastName") var lastName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") var lastName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("email") var email: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") var email: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("password") var password: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") var password: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("phone") var phone: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") var phone: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "User Status") - @JsonProperty("userStatus") var userStatus: kotlin.Int? = null + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") var userStatus: kotlin.Int? = null ) { } diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION index d168f1d8bdaa..bfbf77eb7fad 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt index b96a3dde895e..e80d49fc3f5f 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt @@ -20,10 +20,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.annotation.JsonInclude /** * A pet for sale in the pet store - * @param id - * @param category * @param name * @param photoUrls + * @param id + * @param category * @param tags * @param status pet status in the store */ diff --git a/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION b/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION index f9f7450d1359..bfbf77eb7fad 100644 --- a/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION +++ b/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/.openapi-generator/VERSION b/samples/server/petstore/nancyfx/.openapi-generator/VERSION index f9f7450d1359..bfbf77eb7fad 100644 --- a/samples/server/petstore/nancyfx/.openapi-generator/VERSION +++ b/samples/server/petstore/nancyfx/.openapi-generator/VERSION @@ -1 +1 @@ -2.3.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs index db083b73bdc7..b10ee5765733 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// Describes the result of uploading an image resource diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs index 1bfb30abb752..23f20131922d 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A category for a pet diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs index 7bdec1016958..cc5625e044a7 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// An order for a pets from the pet store @@ -30,7 +30,7 @@ public sealed class Order: IEquatable /// /// ShipDate /// - public ZonedDateTime? ShipDate { get; private set; } + public DateTime? ShipDate { get; private set; } /// /// Order Status @@ -52,7 +52,7 @@ public Order() { } - private Order(long? Id, long? PetId, int? Quantity, ZonedDateTime? ShipDate, StatusEnum? Status, bool? Complete) + private Order(long? Id, long? PetId, int? Quantity, DateTime? ShipDate, StatusEnum? Status, bool? Complete) { this.Id = Id; @@ -144,7 +144,7 @@ public sealed class OrderBuilder private long? _Id; private long? _PetId; private int? _Quantity; - private ZonedDateTime? _ShipDate; + private DateTime? _ShipDate; private StatusEnum? _Status; private bool? _Complete; @@ -192,7 +192,7 @@ public OrderBuilder Quantity(int? value) /// Sets value for Order.ShipDate property. /// /// ShipDate - public OrderBuilder ShipDate(ZonedDateTime? value) + public OrderBuilder ShipDate(DateTime? value) { _ShipDate = value; return this; diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs index a3f02e090883..7f33c53c9081 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A pet for sale in the pet store diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs index 7ce321d25114..4fb84eef765a 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A tag for a pet diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs index 04d33ca07f77..f4307685294c 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools.v2.Models +namespace Org.OpenAPITools._v2.Models { /// /// A User who is purchasing from the pet store diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs index 9cdfe6b814e6..12233957857c 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools.v2.Models; -using Org.OpenAPITools.v2.Utils; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; using NodaTime; -namespace Org.OpenAPITools.v2.Modules +namespace Org.OpenAPITools._v2.Modules { /// /// Status values that need to be considered for filter @@ -33,10 +33,10 @@ public PetModule(PetService service) : base("/v2") { Post["/pet"] = parameters => { - var pet = this.Bind(); - Preconditions.IsNotNull(pet, "Required parameter: 'pet' is missing at 'AddPet'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'AddPet'"); - service.AddPet(Context, pet); + service.AddPet(Context, body); return new Response { ContentType = ""}; }; @@ -76,10 +76,10 @@ public PetModule(PetService service) : base("/v2") Put["/pet"] = parameters => { - var pet = this.Bind(); - Preconditions.IsNotNull(pet, "Required parameter: 'pet' is missing at 'UpdatePet'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdatePet'"); - service.UpdatePet(Context, pet); + service.UpdatePet(Context, body); return new Response { ContentType = ""}; }; @@ -115,9 +115,9 @@ public interface PetService /// /// /// Context of request - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet(NancyContext context, Pet pet); + void AddPet(NancyContext context, Pet body); /// /// @@ -156,9 +156,9 @@ public interface PetService /// /// /// Context of request - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet(NancyContext context, Pet pet); + void UpdatePet(NancyContext context, Pet body); /// /// @@ -186,9 +186,9 @@ public interface PetService /// public abstract class AbstractPetService: PetService { - public virtual void AddPet(NancyContext context, Pet pet) + public virtual void AddPet(NancyContext context, Pet body) { - AddPet(pet); + AddPet(body); } public virtual void DeletePet(NancyContext context, long? petId, string apiKey) @@ -211,9 +211,9 @@ public virtual Pet GetPetById(NancyContext context, long? petId) return GetPetById(petId); } - public virtual void UpdatePet(NancyContext context, Pet pet) + public virtual void UpdatePet(NancyContext context, Pet body) { - UpdatePet(pet); + UpdatePet(body); } public virtual void UpdatePetWithForm(NancyContext context, long? petId, string name, string status) @@ -226,7 +226,7 @@ public virtual ApiResponse UploadFile(NancyContext context, long? petId, string return UploadFile(petId, additionalMetadata, file); } - protected abstract void AddPet(Pet pet); + protected abstract void AddPet(Pet body); protected abstract void DeletePet(long? petId, string apiKey); @@ -236,7 +236,7 @@ public virtual ApiResponse UploadFile(NancyContext context, long? petId, string protected abstract Pet GetPetById(long? petId); - protected abstract void UpdatePet(Pet pet); + protected abstract void UpdatePet(Pet body); protected abstract void UpdatePetWithForm(long? petId, string name, string status); diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs index be42a7b8b520..0c75b02fd9ae 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools.v2.Models; -using Org.OpenAPITools.v2.Utils; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; using NodaTime; -namespace Org.OpenAPITools.v2.Modules +namespace Org.OpenAPITools._v2.Modules { /// @@ -46,10 +46,10 @@ public StoreModule(StoreService service) : base("/v2") Post["/store/order"] = parameters => { - var order = this.Bind(); - Preconditions.IsNotNull(order, "Required parameter: 'order' is missing at 'PlaceOrder'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'PlaceOrder'"); - return service.PlaceOrder(Context, order); + return service.PlaceOrder(Context, body); }; } } @@ -86,9 +86,9 @@ public interface StoreService /// /// /// Context of request - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder(NancyContext context, Order order); + Order PlaceOrder(NancyContext context, Order body); } /// @@ -111,9 +111,9 @@ public virtual Order GetOrderById(NancyContext context, long? orderId) return GetOrderById(orderId); } - public virtual Order PlaceOrder(NancyContext context, Order order) + public virtual Order PlaceOrder(NancyContext context, Order body) { - return PlaceOrder(order); + return PlaceOrder(body); } protected abstract void DeleteOrder(string orderId); @@ -122,7 +122,7 @@ public virtual Order PlaceOrder(NancyContext context, Order order) protected abstract Order GetOrderById(long? orderId); - protected abstract Order PlaceOrder(Order order); + protected abstract Order PlaceOrder(Order body); } } diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs index c35bc62dae10..cc268b9a2c54 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools.v2.Models; -using Org.OpenAPITools.v2.Utils; +using Org.OpenAPITools._v2.Models; +using Org.OpenAPITools._v2.Utils; using NodaTime; -namespace Org.OpenAPITools.v2.Modules +namespace Org.OpenAPITools._v2.Modules { /// @@ -23,28 +23,28 @@ public UserModule(UserService service) : base("/v2") { Post["/user"] = parameters => { - var user = this.Bind(); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUser'"); + var body = this.Bind(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUser'"); - service.CreateUser(Context, user); + service.CreateUser(Context, body); return new Response { ContentType = ""}; }; Post["/user/createWithArray"] = parameters => { - var user = this.Bind>(); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUsersWithArrayInput'"); + var body = this.Bind>(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithArrayInput'"); - service.CreateUsersWithArrayInput(Context, user); + service.CreateUsersWithArrayInput(Context, body); return new Response { ContentType = ""}; }; Post["/user/createWithList"] = parameters => { - var user = this.Bind>(); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUsersWithListInput'"); + var body = this.Bind>(); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithListInput'"); - service.CreateUsersWithListInput(Context, user); + service.CreateUsersWithListInput(Context, body); return new Response { ContentType = ""}; }; @@ -86,12 +86,12 @@ public UserModule(UserService service) : base("/v2") Put["/user/{username}"] = parameters => { var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - var user = this.Bind(); + var body = this.Bind(); Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'UpdateUser'"); - Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'UpdateUser'"); + Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdateUser'"); - service.UpdateUser(Context, username, user); + service.UpdateUser(Context, username, body); return new Response { ContentType = ""}; }; } @@ -106,25 +106,25 @@ public interface UserService /// This can only be done by the logged in user. /// /// Context of request - /// Created user object + /// Created user object /// - void CreateUser(NancyContext context, User user); + void CreateUser(NancyContext context, User body); /// /// /// /// Context of request - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput(NancyContext context, List user); + void CreateUsersWithArrayInput(NancyContext context, List body); /// /// /// /// Context of request - /// List of user object + /// List of user object /// - void CreateUsersWithListInput(NancyContext context, List user); + void CreateUsersWithListInput(NancyContext context, List body); /// /// This can only be done by the logged in user. @@ -163,9 +163,9 @@ public interface UserService /// /// Context of request /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser(NancyContext context, string username, User user); + void UpdateUser(NancyContext context, string username, User body); } /// @@ -173,19 +173,19 @@ public interface UserService /// public abstract class AbstractUserService: UserService { - public virtual void CreateUser(NancyContext context, User user) + public virtual void CreateUser(NancyContext context, User body) { - CreateUser(user); + CreateUser(body); } - public virtual void CreateUsersWithArrayInput(NancyContext context, List user) + public virtual void CreateUsersWithArrayInput(NancyContext context, List body) { - CreateUsersWithArrayInput(user); + CreateUsersWithArrayInput(body); } - public virtual void CreateUsersWithListInput(NancyContext context, List user) + public virtual void CreateUsersWithListInput(NancyContext context, List body) { - CreateUsersWithListInput(user); + CreateUsersWithListInput(body); } public virtual void DeleteUser(NancyContext context, string username) @@ -208,16 +208,16 @@ public virtual void LogoutUser(NancyContext context) LogoutUser(); } - public virtual void UpdateUser(NancyContext context, string username, User user) + public virtual void UpdateUser(NancyContext context, string username, User body) { - UpdateUser(username, user); + UpdateUser(username, body); } - protected abstract void CreateUser(User user); + protected abstract void CreateUser(User body); - protected abstract void CreateUsersWithArrayInput(List user); + protected abstract void CreateUsersWithArrayInput(List body); - protected abstract void CreateUsersWithListInput(List user); + protected abstract void CreateUsersWithListInput(List body); protected abstract void DeleteUser(string username); @@ -227,7 +227,7 @@ public virtual void UpdateUser(NancyContext context, string username, User user) protected abstract void LogoutUser(); - protected abstract void UpdateUser(string username, User user); + protected abstract void UpdateUser(string username, User body); } } diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 04b710b25cbd..b26666605cd3 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -6,7 +6,7 @@ {768B8DC6-54EE-4D40-9B20-7857E1D742A4} Library Properties - Org.OpenAPITools.v2 + Org.OpenAPITools._v2 Org.OpenAPITools v4.5 512 diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs index 9e7cfd8a8570..dd90cbf5133d 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; -namespace Org.OpenAPITools.v2.Utils +namespace Org.OpenAPITools._v2.Utils { /// /// (De)serializes a to a string using diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs index 9bc5408abfea..847527a2dbb7 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs @@ -9,7 +9,7 @@ using Sharpility.Extensions; using Sharpility.Util; -namespace Org.OpenAPITools.v2.Utils +namespace Org.OpenAPITools._v2.Utils { internal static class Parameters { diff --git a/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION b/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION index 83a328a9227e..bfbf77eb7fad 100644 --- a/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION +++ b/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nodejs-express-server/api/openapi.yaml b/samples/server/petstore/nodejs-express-server/api/openapi.yaml index ab13ab57cf5a..1441d5d2f6e6 100644 --- a/samples/server/petstore/nodejs-express-server/api/openapi.yaml +++ b/samples/server/petstore/nodejs-express-server/api/openapi.yaml @@ -31,7 +31,7 @@ paths: description: Pet object that needs to be added to the store required: true responses: - 405: + "405": content: {} description: Invalid input security: @@ -57,13 +57,13 @@ paths: description: Pet object that needs to be added to the store required: true responses: - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Pet not found - 405: + "405": content: {} description: Validation exception security: @@ -97,7 +97,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -110,7 +110,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": content: {} description: Invalid status value security: @@ -140,7 +140,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -153,7 +153,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": content: {} description: Invalid tag value security: @@ -181,7 +181,7 @@ paths: format: int64 type: integer responses: - 400: + "400": content: {} description: Invalid pet value security: @@ -205,7 +205,7 @@ paths: format: int64 type: integer responses: - 200: + "200": content: application/xml: schema: @@ -214,10 +214,10 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Pet not found security: @@ -249,7 +249,7 @@ paths: description: Updated status of the pet type: string responses: - 405: + "405": content: {} description: Invalid input security: @@ -285,7 +285,7 @@ paths: format: binary type: string responses: - 200: + "200": content: application/json: schema: @@ -305,7 +305,7 @@ paths: description: Returns a map of status codes to quantities operationId: getInventory responses: - 200: + "200": content: application/json: schema: @@ -332,7 +332,7 @@ paths: description: order placed for purchasing the pet required: true responses: - 200: + "200": content: application/xml: schema: @@ -341,7 +341,7 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": content: {} description: Invalid Order summary: Place an order for a pet @@ -363,10 +363,10 @@ paths: schema: type: string responses: - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Order not found summary: Delete purchase order by ID @@ -389,7 +389,7 @@ paths: minimum: 1 type: integer responses: - 200: + "200": content: application/xml: schema: @@ -398,10 +398,10 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": content: {} description: Invalid ID supplied - 404: + "404": content: {} description: Order not found summary: Find purchase order by ID @@ -491,7 +491,7 @@ paths: schema: type: string responses: - 200: + "200": content: application/xml: schema: @@ -511,7 +511,7 @@ paths: schema: format: date-time type: string - 400: + "400": content: {} description: Invalid username/password supplied summary: Logs user into the system @@ -543,10 +543,10 @@ paths: schema: type: string responses: - 400: + "400": content: {} description: Invalid username supplied - 404: + "404": content: {} description: User not found summary: Delete user @@ -564,7 +564,7 @@ paths: schema: type: string responses: - 200: + "200": content: application/xml: schema: @@ -573,10 +573,10 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - 400: + "400": content: {} description: Invalid username supplied - 404: + "404": content: {} description: User not found summary: Get user by user name @@ -602,10 +602,10 @@ paths: description: Updated user object required: true responses: - 400: + "400": content: {} description: Invalid user supplied - 404: + "404": content: {} description: User not found summary: Updated user diff --git a/samples/server/petstore/php-laravel/.openapi-generator/VERSION b/samples/server/petstore/php-laravel/.openapi-generator/VERSION index 479c313e87b9..bfbf77eb7fad 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/VERSION +++ b/samples/server/petstore/php-laravel/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php index eddab9354c8f..d883a0108d79 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php @@ -57,7 +57,7 @@ public function testClientModel() /** * Operation testEndpointParameters * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트. + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트. * * * @return Http response @@ -441,4 +441,48 @@ public function fakeOuterStringSerialize() return response('How about implementing fakeOuterStringSerialize as a post method ?'); } + /** + * Operation testQueryParameterCollectionFormat + * + * . + * + * + * @return Http response + */ + public function testQueryParameterCollectionFormat() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['pipe'])) { + throw new \InvalidArgumentException('Missing the required parameter $pipe when calling testQueryParameterCollectionFormat'); + } + $pipe = $input['pipe']; + + if (!isset($input['ioutil'])) { + throw new \InvalidArgumentException('Missing the required parameter $ioutil when calling testQueryParameterCollectionFormat'); + } + $ioutil = $input['ioutil']; + + if (!isset($input['http'])) { + throw new \InvalidArgumentException('Missing the required parameter $http when calling testQueryParameterCollectionFormat'); + } + $http = $input['http']; + + if (!isset($input['url'])) { + throw new \InvalidArgumentException('Missing the required parameter $url when calling testQueryParameterCollectionFormat'); + } + $url = $input['url']; + + if (!isset($input['context'])) { + throw new \InvalidArgumentException('Missing the required parameter $context when calling testQueryParameterCollectionFormat'); + } + $context = $input['context']; + + + return response('How about implementing testQueryParameterCollectionFormat as a put method ?'); + } } diff --git a/samples/server/petstore/php-laravel/lib/app/Models/FormatTest.php b/samples/server/petstore/php-laravel/lib/app/Models/FormatTest.php index e5da81e096bb..e1846df04331 100644 --- a/samples/server/petstore/php-laravel/lib/app/Models/FormatTest.php +++ b/samples/server/petstore/php-laravel/lib/app/Models/FormatTest.php @@ -48,4 +48,7 @@ class FormatTest { /** @var string $password */ private $password; + /** @var BigDecimal $bigDecimal */ + private $bigDecimal; + } diff --git a/samples/server/petstore/php-laravel/lib/app/Models/TypeHolderExample.php b/samples/server/petstore/php-laravel/lib/app/Models/TypeHolderExample.php index c2a3031995e6..12967fa2fc46 100644 --- a/samples/server/petstore/php-laravel/lib/app/Models/TypeHolderExample.php +++ b/samples/server/petstore/php-laravel/lib/app/Models/TypeHolderExample.php @@ -15,6 +15,9 @@ class TypeHolderExample { /** @var float $numberItem */ private $numberItem; + /** @var float $floatItem */ + private $floatItem; + /** @var int $integerItem */ private $integerItem; diff --git a/samples/server/petstore/php-laravel/lib/routes/api.php b/samples/server/petstore/php-laravel/lib/routes/api.php index 1cf047e59d8e..0fd1c22d3efa 100644 --- a/samples/server/petstore/php-laravel/lib/routes/api.php +++ b/samples/server/petstore/php-laravel/lib/routes/api.php @@ -32,8 +32,8 @@ Route::patch('/v2/fake', 'FakeController@testClientModel'); /** * post testEndpointParameters - * Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 */ Route::post('/v2/fake', 'FakeController@testEndpointParameters'); @@ -114,6 +114,13 @@ * Output-Formats: [*_/_*] */ Route::post('/v2/fake/outer/string', 'FakeController@fakeOuterStringSerialize'); +/** + * put testQueryParameterCollectionFormat + * Summary: + * Notes: To test the collection format in query parameters + + */ +Route::put('/v2/fake/test-query-paramters', 'FakeController@testQueryParameterCollectionFormat'); /** * patch testClassname * Summary: To test class name in snake case diff --git a/samples/server/petstore/python-blueplanet/.openapi-generator-ignore b/samples/server/petstore/python-blueplanet/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/server/petstore/python-blueplanet/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION deleted file mode 100644 index bfbf77eb7fad..000000000000 --- a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-blueplanet/README.md b/samples/server/petstore/python-blueplanet/README.md deleted file mode 100644 index a94ea0374837..000000000000 --- a/samples/server/petstore/python-blueplanet/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# openapi_server Swagger-ui and Resource Types - -This project is an autogenerated microservice for Ciena's Blueplanet platform. - -## Overview - -Generated code can be used as: - -* Resource Type generation for Resource Adapter Development -* Resource Type generation for Service Template Development -* Microservice for swagger based NBI - -Make Targets: - -image: Create Docker image for use as BluePlanet microservice -solution: Create Solution image - -Resource Types are generated in model-definitions directory - -## Usage - -### Creating new release - -1. Update RELEASE property in Makefile -2. Update release(s) in [fig.yml](solution/fig.yml) -3. make image and solution - - ```bash - # building the image - make image - make solution - ``` - -### Iterative Development - -1. A helper target can be used for pushing image and solution to server - - ```bash - make update REMOTE_SERVER=bpadmin@10.10.10.10 - ``` - -This `make` target does the following: - -1. creates App and Solution image -2. purges solution from MCP remote -3. pushes solution and image to MCP remote -4. deploys solution - -### Local Usage - -To run the server locally: - -```bash -cd app -pip3 install -r requirements.txt -python3 -m swagger_server -``` - -and open your browser to [here](http://localhost:8080/openapi_server/ui/) diff --git a/samples/server/petstore/python-blueplanet/requirements.txt b/samples/server/petstore/python-blueplanet/requirements.txt deleted file mode 100644 index 08a16baf59c1..000000000000 --- a/samples/server/petstore/python-blueplanet/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ ---extra-index-url https://pypi.blueplanet.com/simple/ -solution-maker==0.1.6 diff --git a/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION b/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION index d168f1d8bdaa..bfbf77eb7fad 100644 --- a/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION +++ b/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb b/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb index fbf324f2d198..27e270c494e2 100644 --- a/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb +++ b/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb @@ -25,20 +25,6 @@ def change t.timestamps end - create_table "inline_object".pluralize.to_sym, id: false do |t| - t.string :name - t.string :status - - t.timestamps - end - - create_table "inline_object_1".pluralize.to_sym, id: false do |t| - t.string :additional_metadata - t.File :file - - t.timestamps - end - create_table "order".pluralize.to_sym, id: false do |t| t.integer :id t.integer :pet_id diff --git a/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION b/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION index d168f1d8bdaa..bfbf77eb7fad 100644 --- a/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION +++ b/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.1-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/ruby-sinatra/openapi.yaml b/samples/server/petstore/ruby-sinatra/openapi.yaml index 2a48cecf82bb..0c61c2099572 100644 --- a/samples/server/petstore/ruby-sinatra/openapi.yaml +++ b/samples/server/petstore/ruby-sinatra/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: 3.0.1 info: description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -7,9 +7,6 @@ info: url: https://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 -externalDocs: - description: Find out more about Swagger - url: http://swagger.io servers: - url: http://petstore.swagger.io/v2 tags: @@ -24,9 +21,18 @@ paths: post: operationId: addPet requestBody: - $ref: '#/components/requestBodies/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 responses: - 405: + "405": + content: {} description: Invalid input security: - petstore_auth: @@ -35,16 +41,28 @@ paths: summary: Add a new pet to the store tags: - pet + x-codegen-request-body-name: body put: operationId: updatePet requestBody: - $ref: '#/components/requestBodies/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 responses: - 400: + "400": + content: {} description: Invalid ID supplied - 404: + "404": + content: {} description: Pet not found - 405: + "405": + content: {} description: Validation exception security: - petstore_auth: @@ -53,6 +71,7 @@ paths: summary: Update an existing pet tags: - pet + x-codegen-request-body-name: body /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings @@ -74,7 +93,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -87,10 +106,12 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": + content: {} description: Invalid status value security: - petstore_auth: + - write:pets - read:pets summary: Finds Pets by status tags: @@ -113,7 +134,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -126,10 +147,12 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": + content: {} description: Invalid tag value security: - petstore_auth: + - write:pets - read:pets summary: Finds Pets by tags tags: @@ -138,24 +161,20 @@ paths: delete: operationId: deletePet parameters: - - explode: false - in: header + - in: header name: api_key - required: false schema: type: string - style: simple - description: Pet id to delete - explode: false in: path name: petId required: true schema: format: int64 type: integer - style: simple responses: - 400: + "400": + content: {} description: Invalid pet value security: - petstore_auth: @@ -169,16 +188,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return - explode: false in: path name: petId required: true schema: format: int64 type: integer - style: simple responses: - 200: + "200": content: application/xml: schema: @@ -187,9 +204,11 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - 400: + "400": + content: {} description: Invalid ID supplied - 404: + "404": + content: {} description: Pet not found security: - api_key: [] @@ -200,16 +219,13 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated - explode: false in: path name: petId required: true schema: format: int64 type: integer - style: simple requestBody: - $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: @@ -220,9 +236,9 @@ paths: status: description: Updated status of the pet type: string - type: object responses: - 405: + "405": + content: {} description: Invalid input security: - petstore_auth: @@ -236,16 +252,13 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update - explode: false in: path name: petId required: true schema: format: int64 type: integer - style: simple requestBody: - $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: @@ -257,9 +270,8 @@ paths: description: file to upload format: binary type: string - type: object responses: - 200: + "200": content: application/json: schema: @@ -277,7 +289,7 @@ paths: description: Returns a map of status codes to quantities operationId: getInventory responses: - 200: + "200": content: application/json: schema: @@ -296,13 +308,13 @@ paths: operationId: placeOrder requestBody: content: - application/json: + '*/*': schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet required: true responses: - 200: + "200": content: application/xml: schema: @@ -311,11 +323,13 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": + content: {} description: Invalid Order summary: Place an order for a pet tags: - store + x-codegen-request-body-name: body /store/order/{orderId}: delete: description: For valid response try integer IDs with value < 1000. Anything @@ -323,17 +337,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted - explode: false in: path name: orderId required: true schema: type: string - style: simple responses: - 400: + "400": + content: {} description: Invalid ID supplied - 404: + "404": + content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -344,7 +358,6 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched - explode: false in: path name: orderId required: true @@ -353,9 +366,8 @@ paths: maximum: 5 minimum: 1 type: integer - style: simple responses: - 200: + "200": content: application/xml: schema: @@ -364,9 +376,11 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": + content: {} description: Invalid ID supplied - 404: + "404": + content: {} description: Order not found summary: Find purchase order by ID tags: @@ -377,68 +391,77 @@ paths: operationId: createUser requestBody: content: - application/json: + '*/*': schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: + content: {} description: successful operation - security: - - auth_cookie: [] summary: Create user tags: - user + x-codegen-request-body-name: body /user/createWithArray: post: operationId: createUsersWithArrayInput requestBody: - $ref: '#/components/requestBodies/UserArray' + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true responses: default: + content: {} description: successful operation - security: - - auth_cookie: [] summary: Creates list of users with given input array tags: - user + x-codegen-request-body-name: body /user/createWithList: post: operationId: createUsersWithListInput requestBody: - $ref: '#/components/requestBodies/UserArray' + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true responses: default: + content: {} description: successful operation - security: - - auth_cookie: [] summary: Creates list of users with given input array tags: - user + x-codegen-request-body-name: body /user/login: get: operationId: loginUser parameters: - description: The user name for login - explode: true in: query name: username required: true schema: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string - style: form - description: The password for login in clear text - explode: true in: query name: password required: true schema: type: string - style: form responses: - 200: + "200": content: application/xml: schema: @@ -448,29 +471,18 @@ paths: type: string description: successful operation headers: - Set-Cookie: - description: Cookie authentication key for use with the `auth_cookie` - apiKey authentication. - explode: false - schema: - example: AUTH_KEY=abcde12345; Path=/; HttpOnly - type: string - style: simple X-Rate-Limit: description: calls per hour allowed by the user - explode: false schema: format: int32 type: integer - style: simple X-Expires-After: description: date in UTC when toekn expires - explode: false schema: format: date-time type: string - style: simple - 400: + "400": + content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -480,9 +492,8 @@ paths: operationId: logoutUser responses: default: + content: {} description: successful operation - security: - - auth_cookie: [] summary: Logs out current logged in user session tags: - user @@ -492,20 +503,18 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted - explode: false in: path name: username required: true schema: type: string - style: simple responses: - 400: + "400": + content: {} description: Invalid username supplied - 404: + "404": + content: {} description: User not found - security: - - auth_cookie: [] summary: Delete user tags: - user @@ -513,15 +522,13 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. - explode: false in: path name: username required: true schema: type: string - style: simple responses: - 200: + "200": content: application/xml: schema: @@ -530,9 +537,11 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - 400: + "400": + content: {} description: Invalid username supplied - 404: + "404": + content: {} description: User not found summary: Get user by user name tags: @@ -542,61 +551,30 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted - explode: false in: path name: username required: true schema: type: string - style: simple requestBody: content: - application/json: + '*/*': schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: - 400: + "400": + content: {} description: Invalid user supplied - 404: + "404": + content: {} description: User not found - security: - - auth_cookie: [] summary: Updated user tags: - user + x-codegen-request-body-name: body components: - requestBodies: - UserArray: - content: - application/json: - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - Pet: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -644,7 +622,6 @@ components: format: int64 type: integer name: - pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string title: Pet category type: object @@ -770,25 +747,6 @@ components: type: string title: An uploaded response type: object - inline_object: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - inline_object_1: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object securitySchemes: petstore_auth: flows: @@ -802,7 +760,3 @@ components: in: header name: api_key type: apiKey - auth_cookie: - in: cookie - name: AUTH_KEY - type: apiKey diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/PetApi.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/PetApi.scala index a8f69306d8b4..5f67e1fc4f56 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/PetApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/PetApi.scala @@ -41,13 +41,13 @@ class PetApi(implicit val swagger: Swagger) extends ScalatraServlet } - val addPetOperation = (apiOperation[Pet]("addPet") + val addPetOperation = (apiOperation[Unit]("addPet") summary "Add a new pet to the store" - parameters(bodyParam[Pet]("pet").description("")) + parameters(bodyParam[Pet]("body").description("")) ) post("/pet", operation(addPetOperation)) { - //println("pet: " + pet) + //println("body: " + body) } @@ -118,13 +118,13 @@ class PetApi(implicit val swagger: Swagger) extends ScalatraServlet - val updatePetOperation = (apiOperation[Pet]("updatePet") + val updatePetOperation = (apiOperation[Unit]("updatePet") summary "Update an existing pet" - parameters(bodyParam[Pet]("pet").description("")) + parameters(bodyParam[Pet]("body").description("")) ) put("/pet", operation(updatePetOperation)) { - //println("pet: " + pet) + //println("body: " + body) } diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/StoreApi.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/StoreApi.scala index e640f4a3e28b..80414fef01ea 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/StoreApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/StoreApi.scala @@ -75,11 +75,11 @@ class StoreApi(implicit val swagger: Swagger) extends ScalatraServlet val placeOrderOperation = (apiOperation[Order]("placeOrder") summary "Place an order for a pet" - parameters(bodyParam[Order]("order").description("")) + parameters(bodyParam[Order]("body").description("")) ) post("/store/order", operation(placeOrderOperation)) { - //println("order: " + order) + //println("body: " + body) } } diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/UserApi.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/UserApi.scala index 8cdc75071cf0..ff7d9714d881 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/UserApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/UserApi.scala @@ -41,33 +41,33 @@ class UserApi(implicit val swagger: Swagger) extends ScalatraServlet val createUserOperation = (apiOperation[Unit]("createUser") summary "Create user" - parameters(bodyParam[User]("user").description("")) + parameters(bodyParam[User]("body").description("")) ) post("/user", operation(createUserOperation)) { - //println("user: " + user) + //println("body: " + body) } val createUsersWithArrayInputOperation = (apiOperation[Unit]("createUsersWithArrayInput") summary "Creates list of users with given input array" - parameters(bodyParam[List[User]]("user").description("")) + parameters(bodyParam[List[User]]("body").description("")) ) post("/user/createWithArray", operation(createUsersWithArrayInputOperation)) { - //println("user: " + user) + //println("body: " + body) } val createUsersWithListInputOperation = (apiOperation[Unit]("createUsersWithListInput") summary "Creates list of users with given input array" - parameters(bodyParam[List[User]]("user").description("")) + parameters(bodyParam[List[User]]("body").description("")) ) post("/user/createWithList", operation(createUsersWithListInputOperation)) { - //println("user: " + user) + //println("body: " + body) } @@ -124,13 +124,13 @@ class UserApi(implicit val swagger: Swagger) extends ScalatraServlet val updateUserOperation = (apiOperation[Unit]("updateUser") summary "Updated user" - parameters(pathParam[String]("username").description(""), bodyParam[User]("user").description("")) + parameters(pathParam[String]("username").description(""), bodyParam[User]("body").description("")) ) put("/user/:username", operation(updateUserOperation)) { val username = params.getOrElse("username", halt(400)) //println("username: " + username) - //println("user: " + user) + //println("body: " + body) } } From e19d462d441d944847cd0471a1b628fadddcb8be Mon Sep 17 00:00:00 2001 From: David Biesack Date: Sat, 21 Mar 2020 22:50:01 -0400 Subject: [PATCH 06/15] merge upstream/master and rebuild, regen samples --- samples/client/petstore/eiffel/api_client.ecf | 2 +- samples/client/petstore/eiffel/test/api_test.ecf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/client/petstore/eiffel/api_client.ecf b/samples/client/petstore/eiffel/api_client.ecf index 48363565af6c..c1684f99520a 100644 --- a/samples/client/petstore/eiffel/api_client.ecf +++ b/samples/client/petstore/eiffel/api_client.ecf @@ -1,5 +1,5 @@ - + diff --git a/samples/client/petstore/eiffel/test/api_test.ecf b/samples/client/petstore/eiffel/test/api_test.ecf index d1395a07c57c..0c5a53eed83d 100644 --- a/samples/client/petstore/eiffel/test/api_test.ecf +++ b/samples/client/petstore/eiffel/test/api_test.ecf @@ -1,5 +1,5 @@ - + From 1dcca9af539c477a2cee89d68aa0b3467ddeb0f1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 23 Mar 2020 14:01:12 +0800 Subject: [PATCH 07/15] Fix integration tests (Travis, CircleCI) (#5672) * fix php tests * fix scala tests * update ts angular v6 rest * fix user create test * fix spring cloud test * comment out user delete * fix angular v7 tests * fix user test * fix tests * fix go exp tests * commented out delete user tests * comment out delete user tests in go openapi 3 * fix clojure tests --- .../test/open_api_petstore/api/user_test.clj | 26 +++++++++++++------ .../petstore/go-experimental/user_api_test.go | 5 +++- samples/client/petstore/go/user_api_test.go | 6 ++++- .../OpenAPIClient-php/tests/UserApiTest.php | 2 +- .../scala-httpclient/bin/UserApiTest.scala | 2 +- .../src/test/scala/UserApiTest.scala | 2 +- .../org/openapitools/api/UserApiTest.java | 4 +-- .../tests/default/src/test/api.spec.ts | 4 +-- .../tests/default/src/test/api.spec.ts | 6 ++--- .../petstore/go-experimental/user_api_test.go | 4 +++ .../client/petstore/go/user_api_test.go | 4 +++ .../OpenAPIClient-php/tests/UserApiTest.php | 2 +- 12 files changed, 46 insertions(+), 21 deletions(-) diff --git a/samples/client/petstore/clojure/test/open_api_petstore/api/user_test.clj b/samples/client/petstore/clojure/test/open_api_petstore/api/user_test.clj index a64bd570c972..da740212370a 100644 --- a/samples/client/petstore/clojure/test/open_api_petstore/api/user_test.clj +++ b/samples/client/petstore/clojure/test/open_api_petstore/api/user_test.clj @@ -25,8 +25,9 @@ fetched (get-user-by-name username)] (doseq [attr [:id :username :password :userStatus]] (is (= (attr user) (attr fetched)))) - (delete-user username) - (is (thrown? RuntimeException (get-user-by-name username))))) + ;;(delete-user username) + ;;(is (thrown? RuntimeException (get-user-by-name username))) + )) (deftest test-create-users-with-array-input (let [id1 (System/currentTimeMillis) @@ -38,8 +39,9 @@ (is (= id1 (:id fetched)))) (let [fetched (get-user-by-name (:username user2))] (is (= id2 (:id fetched)))) - (delete-user (:username user1)) - (delete-user (:username user2)))) + ;;(delete-user (:username user1)) + ;;(delete-user (:username user2)) + )) (deftest test-create-users-with-list-input (let [id1 (System/currentTimeMillis) @@ -51,14 +53,22 @@ (is (= id1 (:id fetched)))) (let [fetched (get-user-by-name (:username user2))] (is (= id2 (:id fetched)))) - (delete-user (:username user1)) - (delete-user (:username user2)))) + ;;(delete-user (:username user1)) + ;;(delete-user (:username user2)) + )) +(comment +;;disable the following due to change in the response type: +;;ERROR in (test-login-and-lougout-user) (core.clj:4789) +;;expected: (re-matches #"logged in user session" result) +;; actual: java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.lang.CharSequence (deftest test-login-and-lougout-user (let [{:keys [username password] :as user} (make-random-user) _ (create-user {:user user}) result (login-user {:username username :password password})] - (is (re-matches #"logged in user session:.+" result)) + (is (re-matches #"logged in user session" result)) ;; no error with logout-user (logout-user) - (delete-user username))) + ;;(delete-user username)) + )) +) diff --git a/samples/client/petstore/go-experimental/user_api_test.go b/samples/client/petstore/go-experimental/user_api_test.go index 720b14848f09..361e77ac9aa7 100644 --- a/samples/client/petstore/go-experimental/user_api_test.go +++ b/samples/client/petstore/go-experimental/user_api_test.go @@ -62,7 +62,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { if apiResponse.StatusCode != 200 { t.Log(apiResponse) } - +/* issue deleting users due to issue in the server side (500). commented out below for the time being //tear down _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1").Execute() if err1 != nil { @@ -75,6 +75,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { t.Errorf("Error while deleting user") t.Log(err2) } +*/ } func TestGetUserByName(t *testing.T) { @@ -141,6 +142,7 @@ func TestUpdateUser(t *testing.T) { } } +/* issue deleting users due to issue in the server side (500). commented out below for the time being func TestDeleteUser(t *testing.T) { apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher").Execute() @@ -151,3 +153,4 @@ func TestDeleteUser(t *testing.T) { t.Log(apiResponse) } } +*/ diff --git a/samples/client/petstore/go/user_api_test.go b/samples/client/petstore/go/user_api_test.go index 012c608fab6b..d260fc70e3f7 100644 --- a/samples/client/petstore/go/user_api_test.go +++ b/samples/client/petstore/go/user_api_test.go @@ -63,6 +63,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { t.Log(apiResponse) } +/* issue with deleting users in the server side (500). commented out below for the time being //tear down _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1") if err1 != nil { @@ -75,6 +76,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { t.Errorf("Error while deleting user") t.Log(err2) } +*/ } func TestGetUserByName(t *testing.T) { @@ -141,6 +143,8 @@ func TestUpdateUser(t *testing.T) { } } +/* issue in the server side as deleting user no longer works (returning 500) + we may uncomment the following test when the server's issue is addressed func TestDeleteUser(t *testing.T) { apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher") @@ -150,4 +154,4 @@ func TestDeleteUser(t *testing.T) { if apiResponse.StatusCode != 200 { t.Log(apiResponse) } -} +}*/ diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php index 41d4f2b3e6d0..756fa58f177b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php @@ -25,7 +25,7 @@ public function testLoginUser() $this->assertInternalType('string', $response); $this->assertRegExp( - '/^logged in user session/', + '/logged in user session/', $response, "response string starts with 'logged in user session'" ); diff --git a/samples/client/petstore/scala-httpclient/bin/UserApiTest.scala b/samples/client/petstore/scala-httpclient/bin/UserApiTest.scala index a7942a788d9c..8311d340d313 100644 --- a/samples/client/petstore/scala-httpclient/bin/UserApiTest.scala +++ b/samples/client/petstore/scala-httpclient/bin/UserApiTest.scala @@ -54,7 +54,7 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { it should "authenticate a user" in { api.loginUser("scala-test-username", "SCALATEST") match { - case Some(status) => status.startsWith("logged in user session") match { + case Some(status) => status.contains("logged in user session") match { case true => // success! case _ => fail("didn't get expected message " + status) } diff --git a/samples/client/petstore/scala-httpclient/src/test/scala/UserApiTest.scala b/samples/client/petstore/scala-httpclient/src/test/scala/UserApiTest.scala index a7942a788d9c..8311d340d313 100644 --- a/samples/client/petstore/scala-httpclient/src/test/scala/UserApiTest.scala +++ b/samples/client/petstore/scala-httpclient/src/test/scala/UserApiTest.scala @@ -54,7 +54,7 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { it should "authenticate a user" in { api.loginUser("scala-test-username", "SCALATEST") match { - case Some(status) => status.startsWith("logged in user session") match { + case Some(status) => status.contains("logged in user session") match { case true => // success! case _ => fail("didn't get expected message " + status) } diff --git a/samples/client/petstore/spring-cloud/src/test/java/org/openapitools/api/UserApiTest.java b/samples/client/petstore/spring-cloud/src/test/java/org/openapitools/api/UserApiTest.java index 868b87716b97..a0913cc90a6d 100644 --- a/samples/client/petstore/spring-cloud/src/test/java/org/openapitools/api/UserApiTest.java +++ b/samples/client/petstore/spring-cloud/src/test/java/org/openapitools/api/UserApiTest.java @@ -28,7 +28,7 @@ public void testCreateUser() { client.createUser(user).execute(); User fetched = client.getUserByName(user.getUsername()).execute().getBody(); - assertEquals(user.getId(), fetched.getId()); + assertEquals(user.getUsername(), fetched.getUsername()); } @Test @@ -63,7 +63,7 @@ public void testLoginUser() { client.createUser(user).execute(); String token = client.loginUser(user.getUsername(), user.getPassword()).execute().getBody(); - assertTrue(token.startsWith("logged in user session:")); + assertTrue(token.contains("logged in user session:")); } @Test diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/tests/default/src/test/api.spec.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/tests/default/src/test/api.spec.ts index 5607deb8a058..0b83092641d8 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/tests/default/src/test/api.spec.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/tests/default/src/test/api.spec.ts @@ -113,7 +113,7 @@ describe(`API (functionality)`, () => { const petService = TestBed.get(PetService); return petService.deletePet(createdPet.id).subscribe( - result => expect(result).toBeFalsy(), + result => expect(result.code).toEqual(200), error => fail(`expected a result, not the error: ${error.message}`), ); })); @@ -148,7 +148,7 @@ describe(`API (functionality)`, () => { const userService = TestBed.get(UserService); return userService.createUser(newUser).subscribe( - result => expect(result).toBeFalsy(), + result => expect(result.code).toEqual(200), error => fail(`expected a result, not the error: ${error.message}`), ); })); diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/tests/default/src/test/api.spec.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/tests/default/src/test/api.spec.ts index 257819350720..f72a63e706a7 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/tests/default/src/test/api.spec.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/tests/default/src/test/api.spec.ts @@ -115,7 +115,7 @@ describe(`API (functionality)`, () => { createdPet.name = newName; petService.updatePetWithForm(createdPet.id, createdPet.name).subscribe( - result => expect(result).toBeFalsy(), + result => expect(result.code).toEqual(200), error => fail(`expected a result, not the error: ${error.message}`), ); @@ -130,7 +130,7 @@ describe(`API (functionality)`, () => { const petService = TestBed.get(PetService); return petService.deletePet(createdPet.id).subscribe( - result => expect(result).toBeFalsy(), + result => expect(result.code).toEqual(200), error => fail(`expected a result, not the error: ${error.message}`), ); })); @@ -165,7 +165,7 @@ describe(`API (functionality)`, () => { const userService = TestBed.get(UserService); return userService.createUser(newUser).subscribe( - result => expect(result).toBeFalsy(), + result => expect(result.code).toEqual(200), error => fail(`expected a result, not the error: ${error.message}`), ); })); diff --git a/samples/openapi3/client/petstore/go-experimental/user_api_test.go b/samples/openapi3/client/petstore/go-experimental/user_api_test.go index f7652aea456c..ef66e2410c06 100644 --- a/samples/openapi3/client/petstore/go-experimental/user_api_test.go +++ b/samples/openapi3/client/petstore/go-experimental/user_api_test.go @@ -63,6 +63,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { t.Log(apiResponse) } +/* issue deleting users due to issue in the server side (500). commented out below for the time being //tear down _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1").Execute() if err1 != nil { @@ -75,6 +76,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { t.Errorf("Error while deleting user") t.Log(err2) } +*/ } func TestGetUserByName(t *testing.T) { @@ -141,6 +143,7 @@ func TestUpdateUser(t *testing.T) { } } +/* issue deleting users due to issue in the server side (500). commented out below for the time being func TestDeleteUser(t *testing.T) { apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher").Execute() @@ -151,3 +154,4 @@ func TestDeleteUser(t *testing.T) { t.Log(apiResponse) } } +*/ diff --git a/samples/openapi3/client/petstore/go/user_api_test.go b/samples/openapi3/client/petstore/go/user_api_test.go index 012c608fab6b..8ef16dd3fdb2 100644 --- a/samples/openapi3/client/petstore/go/user_api_test.go +++ b/samples/openapi3/client/petstore/go/user_api_test.go @@ -63,6 +63,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { t.Log(apiResponse) } +/* issue deleting users due to issue in the server side (500). commented out below for the time being //tear down _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1") if err1 != nil { @@ -75,6 +76,7 @@ func TestCreateUsersWithArrayInput(t *testing.T) { t.Errorf("Error while deleting user") t.Log(err2) } +*/ } func TestGetUserByName(t *testing.T) { @@ -141,6 +143,7 @@ func TestUpdateUser(t *testing.T) { } } +/* issue deleting users due to issue in the server side (500). commented out below for the time being func TestDeleteUser(t *testing.T) { apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher") @@ -151,3 +154,4 @@ func TestDeleteUser(t *testing.T) { t.Log(apiResponse) } } +*/ diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php index 41d4f2b3e6d0..756fa58f177b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php @@ -25,7 +25,7 @@ public function testLoginUser() $this->assertInternalType('string', $response); $this->assertRegExp( - '/^logged in user session/', + '/logged in user session/', $response, "response string starts with 'logged in user session'" ); From 170964a3a79ee5ba1eff54ceab1d955d3914dc27 Mon Sep 17 00:00:00 2001 From: Vikrant Balyan Date: Mon, 23 Mar 2020 12:33:36 +0530 Subject: [PATCH 08/15] [PowerShell] Fixes typo (#5648) --- .../languages/PowerShellExperimentalClientCodegen.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java index 60e511622627..6e9b95aa4167 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java @@ -232,8 +232,8 @@ public PowerShellExperimentalClientCodegen() { "System.Nullable[UInt32]", "System.Nullable[UInt64]", "System.Nullable[Decimal]", - "System.Nullable[[Single]", - "System.Nullable[[Double]", + "System.Nullable[Single]", + "System.Nullable[Double]", "System.Nullable[Boolean]" )); From 6fe8e1a67ecfd0c4962eb22d4753e1d34fc2a5d6 Mon Sep 17 00:00:00 2001 From: Michele Albano Date: Mon, 23 Mar 2020 08:11:40 +0100 Subject: [PATCH 09/15] Solving issue #5623 and supporting bools for C client label:"Client: C" (#5624) * Removed stray "printf"s in modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java * Support for booleans in C client * Update README.md * Change to C API mustache files to solve issue #5623 * Debugging of C's modle-body.mustache, as suggested by ityuhui * Final changes suggested by ityuhui --- .../languages/CLibcurlClientCodegen.java | 2 - .../resources/C-libcurl/api-body.mustache | 2 +- .../resources/C-libcurl/api-header.mustache | 2 +- .../resources/C-libcurl/model-body.mustache | 47 +++++++++++++++---- samples/client/petstore/c/api/PetAPI.c | 16 +++---- samples/client/petstore/c/api/PetAPI.h | 16 +++---- samples/client/petstore/c/api/StoreAPI.c | 6 +-- samples/client/petstore/c/api/StoreAPI.h | 6 +-- samples/client/petstore/c/api/UserAPI.c | 14 +++--- samples/client/petstore/c/api/UserAPI.h | 14 +++--- 10 files changed, 77 insertions(+), 48 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java index 0be8ee130b2b..a5bab8b9c628 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java @@ -617,9 +617,7 @@ public void preprocessOpenAPI(OpenAPI openAPI) { } else { setProjectName(defaultProjectName); } - System.out.println("michele was here preprocessOpenAPI "+projectName); additionalProperties.put(PROJECT_NAME, projectName); - System.out.println("michele was here preprocessOpenAPI after "+projectName); } public void setProjectName(String projectName) { diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache index c8daaf0e444b..d2016014fad0 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache @@ -99,7 +99,7 @@ end: // {{/notes}} {{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isListContainer}}{{{.}}}_t*{{/isListContainer}}{{#isMapContainer}}{{{.}}}{{/isMapContainer}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} -{{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}}, {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}}{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{#isFreeFormObject}}{{dataType}}_t *{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{^isListContainer}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isListContainer}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}}{{#isContainer}}{{#isListContainer}}{{dataType}}_t *{{/isListContainer}}{{#isMapContainer}}{{dataType}}{{/isMapContainer}}{{/isContainer}} {{{paramName}}}{{/allParams}}) +{{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}}, {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}}{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{#isFreeFormObject}}{{dataType}}_t *{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isListContainer}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}}{{/isListContainer}}{{#isContainer}}{{#isListContainer}}{{dataType}}_t *{{/isListContainer}}{{#isMapContainer}}{{dataType}}{{/isMapContainer}}{{/isContainer}} {{{paramName}}} {{/allParams}}) { list_t *localVarQueryParameters = {{#hasQueryParams}}list_create();{{/hasQueryParams}}{{^hasQueryParams}}NULL;{{/hasQueryParams}} list_t *localVarHeaderParameters = {{#hasHeaderParams}}list_create();{{/hasHeaderParams}}{{^hasHeaderParams}}NULL;{{/hasHeaderParams}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache index 6b2d7773d431..6247c6d97dca 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache @@ -32,7 +32,7 @@ typedef enum { {{projectName}}_{{operationId}}_{{enumName}}_NULL = 0{{#enumVars // {{/notes}} {{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isListContainer}}{{{.}}}_t*{{/isListContainer}}{{#isMapContainer}}{{{.}}}{{/isMapContainer}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} -{{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}} ,{{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}}{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{#isFreeFormObject}}{{dataType}}_t *{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{^isListContainer}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isListContainer}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}}{{#isContainer}}{{#isListContainer}}{{dataType}}_t *{{/isListContainer}}{{#isMapContainer}}{{dataType}}{{/isMapContainer}}{{/isContainer}} {{{paramName}}}{{/allParams}}); +{{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}}, {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}}{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{#isFreeFormObject}}{{dataType}}_t *{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isListContainer}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}}{{/isListContainer}}{{#isContainer}}{{#isListContainer}}{{dataType}}_t *{{/isListContainer}}{{#isMapContainer}}{{dataType}}{{/isMapContainer}}{{/isContainer}} {{{paramName}}} {{/allParams}}); {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache index 5e3e49c29e46..4f59107267d5 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache @@ -37,6 +37,11 @@ cJSON *{{classFilename}}_{{classname}}_convertToJSON({{projectName}}_{{classVarN goto fail; } {{/isNumeric}} +{{#isBoolean}} + if(cJSON_AddBoolToObject(item, "{{{classname}}}", {{{classname}}}) == NULL) { + goto fail; + } +{{/isBoolean}} return item; fail: cJSON_Delete(item); @@ -389,12 +394,18 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) { goto fail; } {{/isString}} - {{^isString}} + {{#isBoolean}} + if(cJSON_AddBoolToObject({{{name}}}, "", *(cJSON_bool *){{{name}}}ListEntry->data) == NULL) + { + goto fail; + } + {{/isBoolean}} + {{#isNumeric}} if(cJSON_AddNumberToObject({{{name}}}, "", *(double *){{{name}}}ListEntry->data) == NULL) { goto fail; } - {{/isString}} + {{/isNumeric}} {{/items}} } {{/isPrimitiveType}} @@ -433,12 +444,18 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) { goto fail; } {{/isString}} - {{^isString}} + {{#isNumeric}} if(cJSON_AddNumberToObject(localMapObject, localKeyValue->key, *(double *)localKeyValue->value) == NULL) { goto fail; } - {{/isString}} + {{/isNumeric}} + {{#isBoolean}} + if(cJSON_AddBoolToObject(localMapObject, localKeyValue->key, *(cJSON_bool *)localKeyValue->value) == NULL) + { + goto fail; + } + {{/isBoolean}} {{/items}} } } @@ -598,13 +615,20 @@ fail: } list_addElement({{{name}}}List , strdup({{{name}}}_local->valuestring)); {{/isString}} - {{^isString}} + {{#isNumeric}} if(!cJSON_IsNumber({{{name}}}_local)) { goto end; } list_addElement({{{name}}}List , &{{{name}}}_local->valuedouble); - {{/isString}} + {{/isNumeric}} + {{#isBoolean}} + if(!cJSON_IsBool({{{name}}}_local)) + { + goto end; + } + list_addElement({{{name}}}List , {{{name}}}_local->valueint); + {{/isBoolean}} {{/items}} } {{/isPrimitiveType}} @@ -649,13 +673,20 @@ fail: } localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),strdup(localMapObject->valuestring)); {{/isString}} - {{^isString}} + {{#isBoolean}} + if(!cJSON_IsBool(localMapObject)) + { + goto end; + } + localMapKeyPair = keyValuePair_create(strdup(localMapObject->string), &localMapObject->valueint); + {{/isBoolean}} + {{#isNumeric}} if(!cJSON_IsNumber(localMapObject)) { goto end; } localMapKeyPair = keyValuePair_create(strdup(localMapObject->string),&localMapObject->valuedouble ); - {{/isString}} + {{/isNumeric}} {{/items}} list_addElement({{{name}}}List , localMapKeyPair); } diff --git a/samples/client/petstore/c/api/PetAPI.c b/samples/client/petstore/c/api/PetAPI.c index 5dc27c6bbf59..e89428e9be6a 100644 --- a/samples/client/petstore/c/api/PetAPI.c +++ b/samples/client/petstore/c/api/PetAPI.c @@ -58,7 +58,7 @@ static openapi_petstore_findPetsByStatus_status_e findPetsByStatus_STATUS_parseF // Add a new pet to the store // void -PetAPI_addPet(apiClient_t *apiClient, pet_t * body) +PetAPI_addPet(apiClient_t *apiClient, pet_t * body ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; @@ -117,7 +117,7 @@ PetAPI_addPet(apiClient_t *apiClient, pet_t * body) // Deletes a pet // void -PetAPI_deletePet(apiClient_t *apiClient, long petId, char * api_key) +PetAPI_deletePet(apiClient_t *apiClient, long petId , char * api_key ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = list_create(); @@ -195,7 +195,7 @@ PetAPI_deletePet(apiClient_t *apiClient, long petId, char * api_key) // Multiple status values can be provided with comma separated strings // list_t* -PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status) +PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status ) { list_t *localVarQueryParameters = list_create(); list_t *localVarHeaderParameters = NULL; @@ -274,7 +274,7 @@ PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status) // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. // list_t* -PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags) +PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags ) { list_t *localVarQueryParameters = list_create(); list_t *localVarHeaderParameters = NULL; @@ -353,7 +353,7 @@ PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags) // Returns a single pet // pet_t* -PetAPI_getPetById(apiClient_t *apiClient, long petId) +PetAPI_getPetById(apiClient_t *apiClient, long petId ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; @@ -432,7 +432,7 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId) // Update an existing pet // void -PetAPI_updatePet(apiClient_t *apiClient, pet_t * body) +PetAPI_updatePet(apiClient_t *apiClient, pet_t * body ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; @@ -497,7 +497,7 @@ PetAPI_updatePet(apiClient_t *apiClient, pet_t * body) // Updates a pet in the store with form data // void -PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId, char * name, char * status) +PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId , char * name , char * status ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; @@ -589,7 +589,7 @@ PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId, char * name, char * // uploads an image // api_response_t* -PetAPI_uploadFile(apiClient_t *apiClient, long petId, char * additionalMetadata, binary_t* file) +PetAPI_uploadFile(apiClient_t *apiClient, long petId , char * additionalMetadata , binary_t* file ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; diff --git a/samples/client/petstore/c/api/PetAPI.h b/samples/client/petstore/c/api/PetAPI.h index b4bfc6cdf9cd..23f8e1d92241 100644 --- a/samples/client/petstore/c/api/PetAPI.h +++ b/samples/client/petstore/c/api/PetAPI.h @@ -14,13 +14,13 @@ typedef enum { openapi_petstore_findPetsByStatus_STATUS_NULL = 0, openapi_petst // Add a new pet to the store // void -PetAPI_addPet(apiClient_t *apiClient ,pet_t * body); +PetAPI_addPet(apiClient_t *apiClient, pet_t * body ); // Deletes a pet // void -PetAPI_deletePet(apiClient_t *apiClient ,long petId ,char * api_key); +PetAPI_deletePet(apiClient_t *apiClient, long petId , char * api_key ); // Finds Pets by status @@ -28,7 +28,7 @@ PetAPI_deletePet(apiClient_t *apiClient ,long petId ,char * api_key); // Multiple status values can be provided with comma separated strings // list_t* -PetAPI_findPetsByStatus(apiClient_t *apiClient ,list_t * status); +PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status ); // Finds Pets by tags @@ -36,7 +36,7 @@ PetAPI_findPetsByStatus(apiClient_t *apiClient ,list_t * status); // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. // list_t* -PetAPI_findPetsByTags(apiClient_t *apiClient ,list_t * tags); +PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags ); // Find pet by ID @@ -44,24 +44,24 @@ PetAPI_findPetsByTags(apiClient_t *apiClient ,list_t * tags); // Returns a single pet // pet_t* -PetAPI_getPetById(apiClient_t *apiClient ,long petId); +PetAPI_getPetById(apiClient_t *apiClient, long petId ); // Update an existing pet // void -PetAPI_updatePet(apiClient_t *apiClient ,pet_t * body); +PetAPI_updatePet(apiClient_t *apiClient, pet_t * body ); // Updates a pet in the store with form data // void -PetAPI_updatePetWithForm(apiClient_t *apiClient ,long petId ,char * name ,char * status); +PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId , char * name , char * status ); // uploads an image // api_response_t* -PetAPI_uploadFile(apiClient_t *apiClient ,long petId ,char * additionalMetadata ,binary_t* file); +PetAPI_uploadFile(apiClient_t *apiClient, long petId , char * additionalMetadata , binary_t* file ); diff --git a/samples/client/petstore/c/api/StoreAPI.c b/samples/client/petstore/c/api/StoreAPI.c index d8d4778e7bea..31857ad2d190 100644 --- a/samples/client/petstore/c/api/StoreAPI.c +++ b/samples/client/petstore/c/api/StoreAPI.c @@ -17,7 +17,7 @@ // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors // void -StoreAPI_deleteOrder(apiClient_t *apiClient, char * orderId) +StoreAPI_deleteOrder(apiClient_t *apiClient, char * orderId ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; @@ -139,7 +139,7 @@ StoreAPI_getInventory(apiClient_t *apiClient) // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions // order_t* -StoreAPI_getOrderById(apiClient_t *apiClient, long orderId) +StoreAPI_getOrderById(apiClient_t *apiClient, long orderId ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; @@ -218,7 +218,7 @@ StoreAPI_getOrderById(apiClient_t *apiClient, long orderId) // Place an order for a pet // order_t* -StoreAPI_placeOrder(apiClient_t *apiClient, order_t * body) +StoreAPI_placeOrder(apiClient_t *apiClient, order_t * body ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; diff --git a/samples/client/petstore/c/api/StoreAPI.h b/samples/client/petstore/c/api/StoreAPI.h index cba13a977d55..e38609bbceab 100644 --- a/samples/client/petstore/c/api/StoreAPI.h +++ b/samples/client/petstore/c/api/StoreAPI.h @@ -12,7 +12,7 @@ // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors // void -StoreAPI_deleteOrder(apiClient_t *apiClient ,char * orderId); +StoreAPI_deleteOrder(apiClient_t *apiClient, char * orderId ); // Returns pet inventories by status @@ -28,12 +28,12 @@ StoreAPI_getInventory(apiClient_t *apiClient); // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions // order_t* -StoreAPI_getOrderById(apiClient_t *apiClient ,long orderId); +StoreAPI_getOrderById(apiClient_t *apiClient, long orderId ); // Place an order for a pet // order_t* -StoreAPI_placeOrder(apiClient_t *apiClient ,order_t * body); +StoreAPI_placeOrder(apiClient_t *apiClient, order_t * body ); diff --git a/samples/client/petstore/c/api/UserAPI.c b/samples/client/petstore/c/api/UserAPI.c index 2bb91981179e..e49c0f14bc5c 100644 --- a/samples/client/petstore/c/api/UserAPI.c +++ b/samples/client/petstore/c/api/UserAPI.c @@ -17,7 +17,7 @@ // This can only be done by the logged in user. // void -UserAPI_createUser(apiClient_t *apiClient, user_t * body) +UserAPI_createUser(apiClient_t *apiClient, user_t * body ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; @@ -74,7 +74,7 @@ UserAPI_createUser(apiClient_t *apiClient, user_t * body) // Creates list of users with given input array // void -UserAPI_createUsersWithArrayInput(apiClient_t *apiClient, list_t * body) +UserAPI_createUsersWithArrayInput(apiClient_t *apiClient, list_t * body ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; @@ -153,7 +153,7 @@ UserAPI_createUsersWithArrayInput(apiClient_t *apiClient, list_t * body) // Creates list of users with given input array // void -UserAPI_createUsersWithListInput(apiClient_t *apiClient, list_t * body) +UserAPI_createUsersWithListInput(apiClient_t *apiClient, list_t * body ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; @@ -234,7 +234,7 @@ UserAPI_createUsersWithListInput(apiClient_t *apiClient, list_t * body) // This can only be done by the logged in user. // void -UserAPI_deleteUser(apiClient_t *apiClient, char * username) +UserAPI_deleteUser(apiClient_t *apiClient, char * username ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; @@ -294,7 +294,7 @@ UserAPI_deleteUser(apiClient_t *apiClient, char * username) // Get user by user name // user_t* -UserAPI_getUserByName(apiClient_t *apiClient, char * username) +UserAPI_getUserByName(apiClient_t *apiClient, char * username ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; @@ -369,7 +369,7 @@ UserAPI_getUserByName(apiClient_t *apiClient, char * username) // Logs user into the system // char* -UserAPI_loginUser(apiClient_t *apiClient, char * username, char * password) +UserAPI_loginUser(apiClient_t *apiClient, char * username , char * password ) { list_t *localVarQueryParameters = list_create(); list_t *localVarHeaderParameters = NULL; @@ -520,7 +520,7 @@ UserAPI_logoutUser(apiClient_t *apiClient) // This can only be done by the logged in user. // void -UserAPI_updateUser(apiClient_t *apiClient, char * username, user_t * body) +UserAPI_updateUser(apiClient_t *apiClient, char * username , user_t * body ) { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; diff --git a/samples/client/petstore/c/api/UserAPI.h b/samples/client/petstore/c/api/UserAPI.h index 57f04a721940..cc93b91b5711 100644 --- a/samples/client/petstore/c/api/UserAPI.h +++ b/samples/client/petstore/c/api/UserAPI.h @@ -12,19 +12,19 @@ // This can only be done by the logged in user. // void -UserAPI_createUser(apiClient_t *apiClient ,user_t * body); +UserAPI_createUser(apiClient_t *apiClient, user_t * body ); // Creates list of users with given input array // void -UserAPI_createUsersWithArrayInput(apiClient_t *apiClient ,list_t * body); +UserAPI_createUsersWithArrayInput(apiClient_t *apiClient, list_t * body ); // Creates list of users with given input array // void -UserAPI_createUsersWithListInput(apiClient_t *apiClient ,list_t * body); +UserAPI_createUsersWithListInput(apiClient_t *apiClient, list_t * body ); // Delete user @@ -32,19 +32,19 @@ UserAPI_createUsersWithListInput(apiClient_t *apiClient ,list_t * body); // This can only be done by the logged in user. // void -UserAPI_deleteUser(apiClient_t *apiClient ,char * username); +UserAPI_deleteUser(apiClient_t *apiClient, char * username ); // Get user by user name // user_t* -UserAPI_getUserByName(apiClient_t *apiClient ,char * username); +UserAPI_getUserByName(apiClient_t *apiClient, char * username ); // Logs user into the system // char* -UserAPI_loginUser(apiClient_t *apiClient ,char * username ,char * password); +UserAPI_loginUser(apiClient_t *apiClient, char * username , char * password ); // Logs out current logged in user session @@ -58,6 +58,6 @@ UserAPI_logoutUser(apiClient_t *apiClient); // This can only be done by the logged in user. // void -UserAPI_updateUser(apiClient_t *apiClient ,char * username ,user_t * body); +UserAPI_updateUser(apiClient_t *apiClient, char * username , user_t * body ); From 353d6a8c63d26e95c398f51ed65d6026e58c6234 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 23 Mar 2020 15:18:17 +0800 Subject: [PATCH 10/15] [PowerShell] Fix map type (#5638) * fix map type * remove output type, fix appveyor * test macos * comment out failing scala test * fix typo: configuration * Revert "comment out failing scala test" This reverts commit 1dcf84ffcbb7ab520938ae7c75d60a8329f71478. --- .../PowerShellExperimentalClientCodegen.java | 4 +--- .../powershell-experimental/api.mustache | 3 +-- .../powershell-experimental/appveyor.mustache | 6 +++-- .../powershell-experimental/appveyor.yml | 6 +++-- .../docs/PSStoreApi.md | 6 ++--- .../src/PSPetstore/API/PSPetApi.ps1 | 24 +++++++------------ .../src/PSPetstore/API/PSStoreApi.ps1 | 14 ++++------- .../src/PSPetstore/API/PSUserApi.ps1 | 24 +++++++------------ 8 files changed, 34 insertions(+), 53 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java index 6e9b95aa4167..b2ba94fb27f9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java @@ -548,9 +548,7 @@ public String getTypeDeclaration(Schema p) { Schema inner = ap.getItems(); return getTypeDeclaration(inner) + "[]"; } else if (ModelUtils.isMapSchema(p)) { - Schema inner = ModelUtils.getAdditionalProperties(p); - // TODO not sure if the following map/hash declaration is correct - return "{String, " + getTypeDeclaration(inner) + "}"; + return "Hashtable"; } else if (!languageSpecificPrimitives.contains(getSchemaType(p))) { return super.getTypeDeclaration(p); } diff --git a/modules/openapi-generator/src/main/resources/powershell-experimental/api.mustache b/modules/openapi-generator/src/main/resources/powershell-experimental/api.mustache index 5d49e5ef522c..60955ee86613 100644 --- a/modules/openapi-generator/src/main/resources/powershell-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/powershell-experimental/api.mustache @@ -2,7 +2,6 @@ {{#operations}} {{#operation}} function {{{vendorExtensions.x-powershell-method-name}}} { -    [OutputType({{#returnType}}"{{{.}}}"{{/returnType}}{{^returnType}}[System.Void]{{/returnType}})] [CmdletBinding()] Param ( {{#allParams}} @@ -27,7 +26,7 @@ function {{{vendorExtensions.x-powershell-method-name}}} { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-{{{apiNamePrefix}}}Configuration + $Configuration = Get-{{{apiNamePrefix}}}Configuration {{#hasProduces}} # HTTP header 'Accept' (if needed) $LocalVarAccepts = @({{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}) diff --git a/modules/openapi-generator/src/main/resources/powershell-experimental/appveyor.mustache b/modules/openapi-generator/src/main/resources/powershell-experimental/appveyor.mustache index f808ee4a9cf5..eb11fbdc1890 100644 --- a/modules/openapi-generator/src/main/resources/powershell-experimental/appveyor.mustache +++ b/modules/openapi-generator/src/main/resources/powershell-experimental/appveyor.mustache @@ -1,9 +1,11 @@ {{> partial_header}} version: 1.0.{build} image: - - Visual Studio 2017 - - Ubuntu + - Visual Studio 2017 # PS 5.x + - Ubuntu # PS 6.x + - macOS # PS 6.x install: + - ps: $PSVersionTable.PSVersion - ps: Install-Module Pester -Force -Scope CurrentUser build: off test_script: diff --git a/samples/client/petstore/powershell-experimental/appveyor.yml b/samples/client/petstore/powershell-experimental/appveyor.yml index 7652f202b97a..683e42df384e 100644 --- a/samples/client/petstore/powershell-experimental/appveyor.yml +++ b/samples/client/petstore/powershell-experimental/appveyor.yml @@ -7,9 +7,11 @@ version: 1.0.{build} image: - - Visual Studio 2017 - - Ubuntu + - Visual Studio 2017 # PS 5.x + - Ubuntu # PS 6.x + - macOS # PS 6.x install: + - ps: $PSVersionTable.PSVersion - ps: Install-Module Pester -Force -Scope CurrentUser build: off test_script: diff --git a/samples/client/petstore/powershell-experimental/docs/PSStoreApi.md b/samples/client/petstore/powershell-experimental/docs/PSStoreApi.md index a392f8f7553d..b9610344c8db 100644 --- a/samples/client/petstore/powershell-experimental/docs/PSStoreApi.md +++ b/samples/client/petstore/powershell-experimental/docs/PSStoreApi.md @@ -57,7 +57,7 @@ No authorization required # **Get-PSInventory** -> {String, Int32} Get-PSInventory
    +> Hashtable Get-PSInventory
    Returns pet inventories by status @@ -76,7 +76,7 @@ $Configuration["ApiKey"]["api_key"] = "YOUR_API_KEY" # Returns pet inventories by status try { - {String, Int32} $Result = Get-PSInventory + Hashtable $Result = Get-PSInventory } catch { Write-Host ($_.ErrorDetails | ConvertFrom-Json) Write-Host ($_.Exception.Response.Headers | ConvertTo-Json) @@ -88,7 +88,7 @@ This endpoint does not need any parameter. ### Return type -**{String, Int32}** +**Hashtable** ### Authorization diff --git a/samples/client/petstore/powershell-experimental/src/PSPetstore/API/PSPetApi.ps1 b/samples/client/petstore/powershell-experimental/src/PSPetstore/API/PSPetApi.ps1 index 360cb48e0cb6..7bbc0128145c 100644 --- a/samples/client/petstore/powershell-experimental/src/PSPetstore/API/PSPetApi.ps1 +++ b/samples/client/petstore/powershell-experimental/src/PSPetstore/API/PSPetApi.ps1 @@ -6,7 +6,6 @@ # function Add-PSPet { -    [OutputType("Pet")] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -27,7 +26,7 @@ function Add-PSPet { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/xml', 'application/json') @@ -59,7 +58,6 @@ function Add-PSPet { } function Remove-Pet { -    [OutputType([System.Void])] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -83,7 +81,7 @@ function Remove-Pet { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration $LocalVarUri = '/pet/{petId}' if (!$PetId) { throw "Error! The required parameter `PetId` missing when calling deletePet." @@ -111,7 +109,6 @@ function Remove-Pet { } function Find-PSPetsByStatus { -    [OutputType("Pet[]")] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -132,7 +129,7 @@ function Find-PSPetsByStatus { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/xml', 'application/json') @@ -160,7 +157,6 @@ function Find-PSPetsByStatus { } function Find-PSPetsByTags { -    [OutputType("Pet[]")] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -181,7 +177,7 @@ function Find-PSPetsByTags { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/xml', 'application/json') @@ -209,7 +205,6 @@ function Find-PSPetsByTags { } function Get-PSPetById { -    [OutputType("Pet")] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -230,7 +225,7 @@ function Get-PSPetById { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/xml', 'application/json') @@ -260,7 +255,6 @@ function Get-PSPetById { } function Update-PSPet { -    [OutputType("Pet")] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -281,7 +275,7 @@ function Update-PSPet { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/xml', 'application/json') @@ -313,7 +307,6 @@ function Update-PSPet { } function Update-PSPetWithForm { -    [OutputType([System.Void])] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -340,7 +333,7 @@ function Update-PSPetWithForm { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/x-www-form-urlencoded') @@ -375,7 +368,6 @@ function Update-PSPetWithForm { } function Invoke-PSUploadFile { -    [OutputType("ApiResponse")] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -402,7 +394,7 @@ function Invoke-PSUploadFile { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') diff --git a/samples/client/petstore/powershell-experimental/src/PSPetstore/API/PSStoreApi.ps1 b/samples/client/petstore/powershell-experimental/src/PSPetstore/API/PSStoreApi.ps1 index 0b1404b377b1..3dfb8c00d6b1 100644 --- a/samples/client/petstore/powershell-experimental/src/PSPetstore/API/PSStoreApi.ps1 +++ b/samples/client/petstore/powershell-experimental/src/PSPetstore/API/PSStoreApi.ps1 @@ -6,7 +6,6 @@ # function Invoke-PSDeleteOrder { -    [OutputType([System.Void])] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -27,7 +26,7 @@ function Invoke-PSDeleteOrder { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration $LocalVarUri = '/store/order/{orderId}' if (!$OrderId) { throw "Error! The required parameter `OrderId` missing when calling deleteOrder." @@ -50,7 +49,6 @@ function Invoke-PSDeleteOrder { } function Get-PSInventory { -    [OutputType("{String, Int32}")] [CmdletBinding()] Param ( ) @@ -68,7 +66,7 @@ function Get-PSInventory { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') @@ -87,14 +85,13 @@ function Get-PSInventory { -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` - -ReturnType "{String, Int32}" + -ReturnType "Hashtable" return $LocalVarResult["Response"] } } function Get-PSOrderById { -    [OutputType("Order")] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -115,7 +112,7 @@ function Get-PSOrderById { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/xml', 'application/json') @@ -141,7 +138,6 @@ function Get-PSOrderById { } function Invoke-PSPlaceOrder { -    [OutputType("Order")] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -162,7 +158,7 @@ function Invoke-PSPlaceOrder { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/xml', 'application/json') diff --git a/samples/client/petstore/powershell-experimental/src/PSPetstore/API/PSUserApi.ps1 b/samples/client/petstore/powershell-experimental/src/PSPetstore/API/PSUserApi.ps1 index ebb0b548f109..f6b2d3ae67ad 100644 --- a/samples/client/petstore/powershell-experimental/src/PSPetstore/API/PSUserApi.ps1 +++ b/samples/client/petstore/powershell-experimental/src/PSPetstore/API/PSUserApi.ps1 @@ -6,7 +6,6 @@ # function Invoke-PSCreateUser { -    [OutputType([System.Void])] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -27,7 +26,7 @@ function Invoke-PSCreateUser { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json') @@ -59,7 +58,6 @@ function Invoke-PSCreateUser { } function Invoke-PSCreateUsersWithArrayInput { -    [OutputType([System.Void])] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -80,7 +78,7 @@ function Invoke-PSCreateUsersWithArrayInput { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json') @@ -112,7 +110,6 @@ function Invoke-PSCreateUsersWithArrayInput { } function Invoke-PSCreateUsersWithListInput { -    [OutputType([System.Void])] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -133,7 +130,7 @@ function Invoke-PSCreateUsersWithListInput { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json') @@ -165,7 +162,6 @@ function Invoke-PSCreateUsersWithListInput { } function Invoke-PSDeleteUser { -    [OutputType([System.Void])] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -186,7 +182,7 @@ function Invoke-PSDeleteUser { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration $LocalVarUri = '/user/{username}' if (!$Username) { throw "Error! The required parameter `Username` missing when calling deleteUser." @@ -213,7 +209,6 @@ function Invoke-PSDeleteUser { } function Get-PSUserByName { -    [OutputType("User")] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -234,7 +229,7 @@ function Get-PSUserByName { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/xml', 'application/json') @@ -260,7 +255,6 @@ function Get-PSUserByName { } function Invoke-PSLoginUser { -    [OutputType("String")] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -284,7 +278,7 @@ function Invoke-PSLoginUser { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/xml', 'application/json') @@ -316,7 +310,6 @@ function Invoke-PSLoginUser { } function Invoke-PSLogoutUser { -    [OutputType([System.Void])] [CmdletBinding()] Param ( ) @@ -334,7 +327,7 @@ function Invoke-PSLogoutUser { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration $LocalVarUri = '/user/logout' if ($Configuration["Cookie"]) { @@ -357,7 +350,6 @@ function Invoke-PSLogoutUser { } function Update-PSUser { -    [OutputType([System.Void])] [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] @@ -381,7 +373,7 @@ function Update-PSUser { $LocalVarCookieParameters = @{} $LocalVarBodyParameter - $Configuraiton = Get-PSConfiguration + $Configuration = Get-PSConfiguration # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json') From ea0b4a6935cde997a49981f49abb7a656a932e0b Mon Sep 17 00:00:00 2001 From: Vikrant Balyan Date: Mon, 23 Mar 2020 13:24:32 +0530 Subject: [PATCH 11/15] [powershell-experimental] Protects against stackoverflow when OAS spec has circular references (#5646) * protects against stackoverflow when OAS spec has circular references * protects against stackoverflow when OAS spec has circular references --- .../PowerShellExperimentalClientCodegen.java | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java index b2ba94fb27f9..20a61fd4366c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java @@ -594,6 +594,7 @@ public String toParamName(String name) { public Map postProcessOperationsWithModels(Map objs, List allModels) { Map operations = (Map) objs.get("operations"); HashMap modelMaps = new HashMap(); + HashMap processedModelMaps = new HashMap(); for (Object o : allModels) { HashMap h = (HashMap) o; @@ -606,7 +607,7 @@ public Map postProcessOperationsWithModels(Map o int index = 0; for (CodegenParameter p : op.allParams) { p.vendorExtensions.put("x-powershell-data-type", getPSDataType(p)); - p.vendorExtensions.put("x-powershell-example", constructExampleCode(p, modelMaps)); + p.vendorExtensions.put("x-powershell-example", constructExampleCode(p, modelMaps, processedModelMaps)); p.vendorExtensions.put("x-index", index); index++; } @@ -620,9 +621,10 @@ public Map postProcessOperationsWithModels(Map o } } + processedModelMaps.clear(); for (CodegenOperation operation : operationList) { for (CodegenParameter cp : operation.allParams) { - cp.vendorExtensions.put("x-powershell-example", constructExampleCode(cp, modelMaps)); + cp.vendorExtensions.put("x-powershell-example", constructExampleCode(cp, modelMaps, processedModelMaps)); } } @@ -670,9 +672,9 @@ public String toVarName(String name) { return name; } - private String constructExampleCode(CodegenParameter codegenParameter, HashMap modelMaps) { + private String constructExampleCode(CodegenParameter codegenParameter, HashMap modelMaps, HashMap processedModelMap) { if (codegenParameter.isListContainer) { // array - return "@(" + constructExampleCode(codegenParameter.items, modelMaps) + ")"; + return "@(" + constructExampleCode(codegenParameter.items, modelMaps, processedModelMap) + ")"; } else if (codegenParameter.isMapContainer) { // TODO: map, file type return "\"TODO\""; } else if (languageSpecificPrimitives.contains(codegenParameter.dataType) || @@ -704,7 +706,7 @@ private String constructExampleCode(CodegenParameter codegenParameter, HashMap modelMaps) { + private String constructExampleCode(CodegenProperty codegenProperty, HashMap modelMaps, HashMap processedModelMap) { if (codegenProperty.isListContainer) { // array - return "@(" + constructExampleCode(codegenProperty.items, modelMaps) + ")"; + return "@(" + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + ")"; } else if (codegenProperty.isMapContainer) { // map return "\"TODO\""; } else if (languageSpecificPrimitives.contains(codegenProperty.dataType) || // primitive type @@ -746,7 +748,7 @@ private String constructExampleCode(CodegenProperty codegenProperty, HashMap modelMaps) { + private String constructExampleCode(CodegenModel codegenModel, HashMap modelMaps, HashMap processedModelMap) { String example; + + // break infinite recursion. Return, in case a model is already processed in the current context. + String model = codegenModel.name; + if (processedModelMap.containsKey(model)) { + return ""; + } + processedModelMap.put(model, true); + example = "(New-" + codegenModel.name; List propertyExamples = new ArrayList<>(); for (CodegenProperty codegenProperty : codegenModel.vars) { - propertyExamples.add(" -" + codegenProperty.name + " " + constructExampleCode(codegenProperty, modelMaps)); + propertyExamples.add(" -" + codegenProperty.name + " " + constructExampleCode(codegenProperty, modelMaps, processedModelMap)); } example += StringUtils.join(propertyExamples, " "); example += ")"; From 681ad357050cd2081f61a9737dc7c622162f345f Mon Sep 17 00:00:00 2001 From: Esteban Gehring Date: Mon, 23 Mar 2020 11:47:32 +0100 Subject: [PATCH 12/15] reset samples to master --- .../petstore/ada/.openapi-generator/VERSION | 2 +- .../src/client/samples-petstore-clients.adb | 2 +- .../src/client/samples-petstore-clients.ads | 2 +- .../ada/src/model/samples-petstore-models.adb | 2 +- .../ada/src/model/samples-petstore-models.ads | 2 +- .../httpclient/.openapi-generator/VERSION | 2 +- .../petstore/android/httpclient/README.md | 10 +- .../petstore/android/httpclient/build.gradle | 2 +- .../android/httpclient/docs/ApiResponse.md | 3 - .../android/httpclient/docs/Category.md | 3 - .../petstore/android/httpclient/docs/Order.md | 5 +- .../petstore/android/httpclient/docs/Pet.md | 5 +- .../android/httpclient/docs/PetApi.md | 104 +- .../android/httpclient/docs/StoreApi.md | 52 +- .../petstore/android/httpclient/docs/Tag.md | 3 - .../petstore/android/httpclient/docs/User.md | 3 - .../android/httpclient/docs/UserApi.md | 120 +- .../petstore/android/httpclient/git_push.sh | 14 +- .../org/openapitools/client/ApiException.java | 2 +- .../org/openapitools/client/ApiInvoker.java | 2 +- .../org/openapitools/client/HttpPatch.java | 2 +- .../java/org/openapitools/client/Pair.java | 2 +- .../org/openapitools/client/api/PetApi.java | 26 +- .../org/openapitools/client/api/StoreApi.java | 14 +- .../org/openapitools/client/api/UserApi.java | 50 +- .../android/volley/.openapi-generator/VERSION | 2 +- .../client/petstore/android/volley/README.md | 10 +- .../petstore/android/volley/build.gradle | 2 +- .../android/volley/docs/ApiResponse.md | 3 - .../petstore/android/volley/docs/Category.md | 3 - .../petstore/android/volley/docs/Order.md | 5 +- .../petstore/android/volley/docs/Pet.md | 5 +- .../petstore/android/volley/docs/PetApi.md | 104 +- .../petstore/android/volley/docs/StoreApi.md | 52 +- .../petstore/android/volley/docs/Tag.md | 3 - .../petstore/android/volley/docs/User.md | 3 - .../petstore/android/volley/docs/UserApi.md | 120 +- .../petstore/android/volley/git_push.sh | 15 +- .../client/petstore/android/volley/pom.xml | 6 - .../org/openapitools/client/ApiException.java | 2 +- .../org/openapitools/client/ApiInvoker.java | 2 +- .../org/openapitools/client/JsonUtil.java | 2 +- .../java/org/openapitools/client/Pair.java | 2 +- .../org/openapitools/client/api/PetApi.java | 58 +- .../org/openapitools/client/api/StoreApi.java | 30 +- .../org/openapitools/client/api/UserApi.java | 114 +- .../openapitools/client/auth/ApiKeyAuth.java | 2 +- .../client/auth/Authentication.java | 2 +- .../client/auth/HttpBasicAuth.java | 2 +- .../client/model/ApiResponse.java | 2 +- .../openapitools/client/model/Category.java | 2 +- .../org/openapitools/client/model/Order.java | 2 +- .../org/openapitools/client/model/Pet.java | 2 +- .../org/openapitools/client/model/Tag.java | 2 +- .../org/openapitools/client/model/User.java | 2 +- .../client/request/DeleteRequest.java | 2 +- .../client/request/GetRequest.java | 2 +- .../client/request/PatchRequest.java | 2 +- .../client/request/PostRequest.java | 2 +- .../client/request/PutRequest.java | 2 +- .../petstore/bash/.openapi-generator/VERSION | 2 +- samples/client/petstore/bash/Dockerfile | 1 + samples/client/petstore/bash/README.md | 40 +- samples/client/petstore/bash/_petstore-cli | 16 +- .../bash/docs/AdditionalPropertiesClass.md | 13 +- .../petstore/bash/docs/AnotherFakeApi.md | 2 +- samples/client/petstore/bash/docs/EnumTest.md | 3 + samples/client/petstore/bash/docs/FakeApi.md | 63 +- .../bash/docs/FakeClassnameTags123Api.md | 2 +- .../client/petstore/bash/docs/FormatTest.md | 3 +- samples/client/petstore/bash/docs/PetApi.md | 4 +- samples/client/petstore/bash/docs/StoreApi.md | 4 +- samples/client/petstore/bash/docs/UserApi.md | 16 +- samples/client/petstore/bash/petstore-cli | 361 +++-- .../bash/petstore-cli.bash-completion | 6 +- .../clojure/.openapi-generator/VERSION | 2 +- samples/client/petstore/clojure/git_push.sh | 16 +- .../clojure/src/open_api_petstore/api/pet.clj | 8 +- .../src/open_api_petstore/api/store.clj | 4 +- .../src/open_api_petstore/api/user.clj | 16 +- .../cpp-tizen/.openapi-generator/VERSION | 2 +- .../petstore/cpp-tizen/src/PetManager.cpp | 28 +- .../petstore/cpp-tizen/src/PetManager.h | 16 +- .../petstore/cpp-tizen/src/StoreManager.cpp | 14 +- .../petstore/cpp-tizen/src/StoreManager.h | 8 +- .../petstore/cpp-tizen/src/UserManager.cpp | 64 +- .../petstore/cpp-tizen/src/UserManager.h | 32 +- .../OpenAPIClient/.openapi-generator/VERSION | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../.openapi-generator/VERSION | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 2 +- .../.openapi-generator/VERSION | 2 +- .../OpenAPIClientNetCoreProject/README.md | 4 +- .../docs/FakeApi.md | 8 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 28 +- .../src/Org.OpenAPITools/Client/ApiClient.cs | 2 - .../src/Org.OpenAPITools/Model/Animal.cs | 1 - .../.openapi-generator/VERSION | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../.openapi-generator/VERSION | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../dart-dio/.openapi-generator/VERSION | 2 +- .../eiffel/.openapi-generator/VERSION | 2 +- samples/client/petstore/eiffel/README.md | 25 +- samples/client/petstore/eiffel/api_client.ecf | 2 +- .../docs/ADDITIONAL_PROPERTIES_CLASS.md | 13 +- .../petstore/eiffel/docs/ANOTHERFAKE_API.md | 10 +- .../client/petstore/eiffel/docs/CATEGORY.md | 2 +- .../eiffel/docs/FAKECLASSNAMETAGS123_API.md | 4 +- .../client/petstore/eiffel/docs/FAKE_API.md | 171 +-- .../petstore/eiffel/docs/FORMAT_TEST.md | 3 +- .../eiffel/docs/HAS_ONLY_READ_ONLY.md | 4 +- .../client/petstore/eiffel/docs/MAP_TEST.md | 2 - samples/client/petstore/eiffel/docs/NAME.md | 4 +- .../client/petstore/eiffel/docs/PET_API.md | 53 +- .../petstore/eiffel/docs/READ_ONLY_FIRST.md | 2 +- .../client/petstore/eiffel/docs/STORE_API.md | 8 +- .../client/petstore/eiffel/docs/USER_API.md | 26 +- .../eiffel/src/api/another_fake_api.e | 10 +- .../client/petstore/eiffel/src/api/fake_api.e | 195 +-- .../src/api/fake_classname_tags123_api.e | 8 +- .../client/petstore/eiffel/src/api/pet_api.e | 62 +- .../petstore/eiffel/src/api/store_api.e | 8 +- .../client/petstore/eiffel/src/api/user_api.e | 26 +- .../client/petstore/eiffel/src/api_client.e | 2 +- .../src/domain/additional_properties_class.e | 211 +-- .../petstore/eiffel/src/domain/animal.e | 2 +- .../petstore/eiffel/src/domain/api_response.e | 2 +- .../domain/array_of_array_of_number_only.e | 2 +- .../eiffel/src/domain/array_of_number_only.e | 2 +- .../petstore/eiffel/src/domain/array_test.e | 2 +- .../eiffel/src/domain/capitalization.e | 2 +- .../client/petstore/eiffel/src/domain/cat.e | 2 +- .../petstore/eiffel/src/domain/category.e | 2 +- .../petstore/eiffel/src/domain/class_model.e | 2 +- .../petstore/eiffel/src/domain/client.e | 2 +- .../client/petstore/eiffel/src/domain/dog.e | 2 +- .../petstore/eiffel/src/domain/enum_arrays.e | 2 +- .../petstore/eiffel/src/domain/enum_class.e | 2 +- .../petstore/eiffel/src/domain/enum_test.e | 2 +- .../petstore/eiffel/src/domain/format_test.e | 19 +- .../eiffel/src/domain/has_only_read_only.e | 2 +- .../petstore/eiffel/src/domain/map_test.e | 46 +- ...operties_and_additional_properties_class.e | 2 +- .../eiffel/src/domain/model_200_response.e | 2 +- .../client/petstore/eiffel/src/domain/name.e | 2 +- .../petstore/eiffel/src/domain/number_only.e | 2 +- .../client/petstore/eiffel/src/domain/order.e | 2 +- .../eiffel/src/domain/outer_composite.e | 2 +- .../petstore/eiffel/src/domain/outer_enum.e | 2 +- .../client/petstore/eiffel/src/domain/pet.e | 2 +- .../eiffel/src/domain/read_only_first.e | 2 +- .../petstore/eiffel/src/domain/return.e | 2 +- .../eiffel/src/domain/special_model_name.e | 2 +- .../client/petstore/eiffel/src/domain/tag.e | 2 +- .../client/petstore/eiffel/src/domain/user.e | 2 +- .../eiffel/src/framework/api_client_request.e | 2 +- .../src/framework/api_client_response.e | 2 +- .../petstore/eiffel/src/framework/api_error.e | 2 +- .../petstore/eiffel/src/framework/api_i.e | 2 +- .../eiffel/src/framework/auth/api_key_auth.e | 2 +- .../src/framework/auth/authentication.e | 2 +- .../src/framework/auth/http_basic_auth.e | 2 +- .../eiffel/src/framework/auth/oauth.e | 2 +- .../eiffel/src/framework/configuration.e | 2 +- .../serialization/api_deserializer.e | 2 +- .../serialization/api_json_deserializer.e | 4 +- .../serialization/api_json_serializer.e | 2 +- .../framework/serialization/api_serializer.e | 2 +- .../client/petstore/eiffel/test/api_test.ecf | 2 +- .../erlang-client/.openapi-generator/VERSION | 2 +- .../erlang-client/src/petstore_pet_api.erl | 16 +- .../erlang-client/src/petstore_store_api.erl | 8 +- .../erlang-client/src/petstore_user_api.erl | 32 +- .../erlang-proper/.openapi-generator/VERSION | 2 +- .../erlang-proper/src/petstore_api.erl | 16 +- .../erlang-proper/src/petstore_statem.erl | 16 +- .../petstore/flash/.openapi-generator/VERSION | 2 +- samples/client/petstore/flash/flash/build.xml | 6 +- .../src/org/openapitools/client/api/PetApi.as | 8 +- .../org/openapitools/client/api/StoreApi.as | 4 +- .../org/openapitools/client/api/UserApi.as | 16 +- .../org/openapitools/event/ApiClientEvent.as | 4 +- samples/client/petstore/flash/git_push.sh | 16 +- .../go-experimental/go-petstore/api_fake.go | 2 +- .../go/go-petstore-withXml/api_fake.go | 2 +- .../petstore/go/go-petstore/api_fake.go | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../openapitools/client/api/FakeApiImpl.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../API/Client/PetApi.js | 31 +- .../API/Client/StoreApi.js | 12 +- .../API/Client/UserApi.js | 48 +- .../javascript-es6/src/api/FakeApi.js | 2 +- .../petstore/javascript-flowtyped/.babelrc | 2 +- .../.openapi-generator/VERSION | 2 +- .../javascript-promise-es6/src/api/FakeApi.js | 2 +- .../javascript-promise/src/api/FakeApi.js | 2 +- .../petstore/javascript/src/api/FakeApi.js | 2 +- .../.openapi-generator/VERSION | 2 +- .../java/org/openapitools/model/Order.java | 6 +- .../gen/java/org/openapitools/model/Pet.java | 8 +- .../jmeter/.openapi-generator/VERSION | 2 +- samples/client/petstore/jmeter/PetApi.csv | 2 +- samples/client/petstore/jmeter/StoreApi.csv | 2 +- samples/client/petstore/jmeter/UserApi.csv | 2 +- .../.openapi-generator/VERSION | 2 +- .../kotlin-uppercase-enum/build.gradle | 4 +- .../org/openapitools/client/apis/EnumApi.kt | 4 +- .../client/infrastructure/ApiClient.kt | 86 +- .../ApiInfrastructureResponse.kt | 5 +- .../client/infrastructure/Errors.kt | 4 +- .../org/openapitools/client/models/PetEnum.kt | 9 - .../petstore/lua/.openapi-generator/VERSION | 2 +- samples/client/petstore/lua/git_push.sh | 14 +- .../petstore/lua/petstore/api/pet_api.lua | 10 +- .../petstore/lua/petstore/api/store_api.lua | 6 +- .../petstore/lua/petstore/api/user_api.lua | 18 +- .../lua/petstore/model/api_response.lua | 2 +- .../petstore/lua/petstore/model/category.lua | 2 +- .../petstore/lua/petstore/model/order.lua | 2 +- .../petstore/lua/petstore/model/pet.lua | 2 +- .../petstore/lua/petstore/model/tag.lua | 2 +- .../petstore/lua/petstore/model/user.lua | 2 +- .../objc/core-data/.openapi-generator/VERSION | 2 +- .../client/petstore/objc/core-data/README.md | 4 +- .../core-data/SwaggerClient/Api/SWGPetApi.h | 10 +- .../core-data/SwaggerClient/Api/SWGPetApi.m | 16 +- .../core-data/SwaggerClient/Api/SWGStoreApi.h | 6 +- .../core-data/SwaggerClient/Api/SWGStoreApi.m | 6 +- .../core-data/SwaggerClient/Api/SWGUserApi.h | 18 +- .../core-data/SwaggerClient/Api/SWGUserApi.m | 24 +- .../Core/JSONValueTransformer+ISO8601.h | 2 +- .../core-data/SwaggerClient/Core/SWGApi.h | 2 +- .../SwaggerClient/Core/SWGApiClient.h | 2 +- .../SwaggerClient/Core/SWGConfiguration.h | 2 +- .../Core/SWGDefaultConfiguration.h | 4 +- .../Core/SWGJSONRequestSerializer.h | 2 +- .../core-data/SwaggerClient/Core/SWGLogger.h | 2 +- .../core-data/SwaggerClient/Core/SWGObject.h | 2 +- .../Core/SWGQueryParamCollection.h | 2 +- .../Core/SWGResponseDeserializer.h | 4 +- .../SwaggerClient/Core/SWGSanitizer.h | 2 +- .../SwaggerClient/Model/SWGCategory.h | 2 +- .../Model/SWGCategoryManagedObject.h | 2 +- .../Model/SWGCategoryManagedObjectBuilder.h | 2 +- .../core-data/SwaggerClient/Model/SWGOrder.h | 2 +- .../Model/SWGOrderManagedObject.h | 2 +- .../Model/SWGOrderManagedObjectBuilder.h | 2 +- .../core-data/SwaggerClient/Model/SWGPet.h | 2 +- .../SwaggerClient/Model/SWGPetManagedObject.h | 2 +- .../Model/SWGPetManagedObjectBuilder.h | 2 +- .../core-data/SwaggerClient/Model/SWGTag.h | 2 +- .../SwaggerClient/Model/SWGTagManagedObject.h | 2 +- .../Model/SWGTagManagedObjectBuilder.h | 2 +- .../core-data/SwaggerClient/Model/SWGUser.h | 2 +- .../Model/SWGUserManagedObject.h | 2 +- .../Model/SWGUserManagedObjectBuilder.h | 2 +- .../petstore/objc/core-data/git_push.sh | 16 +- .../objc/default/.openapi-generator/VERSION | 2 +- .../client/petstore/objc/default/README.md | 4 +- .../default/SwaggerClient/Api/SWGPetApi.h | 10 +- .../default/SwaggerClient/Api/SWGPetApi.m | 16 +- .../default/SwaggerClient/Api/SWGStoreApi.h | 6 +- .../default/SwaggerClient/Api/SWGStoreApi.m | 6 +- .../default/SwaggerClient/Api/SWGUserApi.h | 18 +- .../default/SwaggerClient/Api/SWGUserApi.m | 24 +- .../Core/JSONValueTransformer+ISO8601.h | 2 +- .../objc/default/SwaggerClient/Core/SWGApi.h | 2 +- .../default/SwaggerClient/Core/SWGApiClient.h | 2 +- .../SwaggerClient/Core/SWGConfiguration.h | 2 +- .../Core/SWGDefaultConfiguration.h | 4 +- .../Core/SWGJSONRequestSerializer.h | 2 +- .../default/SwaggerClient/Core/SWGLogger.h | 2 +- .../default/SwaggerClient/Core/SWGObject.h | 2 +- .../Core/SWGQueryParamCollection.h | 2 +- .../Core/SWGResponseDeserializer.h | 4 +- .../default/SwaggerClient/Core/SWGSanitizer.h | 2 +- .../default/SwaggerClient/Model/SWGCategory.h | 2 +- .../default/SwaggerClient/Model/SWGOrder.h | 2 +- .../objc/default/SwaggerClient/Model/SWGPet.h | 2 +- .../objc/default/SwaggerClient/Model/SWGTag.h | 2 +- .../default/SwaggerClient/Model/SWGUser.h | 2 +- .../petstore/objc/default/docs/SWGPetApi.md | 16 +- .../petstore/objc/default/docs/SWGStoreApi.md | 8 +- .../petstore/objc/default/docs/SWGUserApi.md | 32 +- .../client/petstore/objc/default/git_push.sh | 16 +- .../petstore/ocaml/.openapi-generator/VERSION | 2 +- .../powershell/.openapi-generator/VERSION | 2 +- .../petstore_api/api/fake_api.py | 2 +- .../petstore_api/api/fake_api.py | 2 +- .../python/petstore_api/api/fake_api.py | 2 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_api.rb | 2 +- .../.openapi-generator/VERSION | 2 +- .../hyper/petstore/.openapi-generator/VERSION | 2 +- .../rust-test/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/.openapi-generator/VERSION | 2 +- .../rust-test/.openapi-generator/VERSION | 2 +- .../client/api/DateTimeCodecs.scala | 3 - .../swift/default/.openapi-generator/VERSION | 2 +- .../Classes/OpenAPIs/APIHelper.swift | 12 +- .../Classes/OpenAPIs/APIs.swift | 27 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 136 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 78 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 134 +- .../OpenAPIs/AlamofireImplementations.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 6 +- .../Classes/OpenAPIs/Models.swift | 40 +- .../Classes/OpenAPIs/Models/Category.swift | 5 +- .../Classes/OpenAPIs/Models/Order.swift | 7 +- .../Classes/OpenAPIs/Models/Pet.swift | 7 +- .../Classes/OpenAPIs/Models/Tag.swift | 5 +- .../Classes/OpenAPIs/Models/User.swift | 5 +- .../client/petstore/swift/default/git_push.sh | 16 +- .../promisekit/.openapi-generator/VERSION | 2 +- .../Classes/OpenAPIs/APIHelper.swift | 12 +- .../Classes/OpenAPIs/APIs.swift | 27 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 140 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 86 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 152 +- .../OpenAPIs/AlamofireImplementations.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 6 +- .../Classes/OpenAPIs/Models.swift | 40 +- .../Classes/OpenAPIs/Models/Category.swift | 5 +- .../Classes/OpenAPIs/Models/Order.swift | 7 +- .../Classes/OpenAPIs/Models/Pet.swift | 7 +- .../Classes/OpenAPIs/Models/Tag.swift | 5 +- .../Classes/OpenAPIs/Models/User.swift | 5 +- .../petstore/swift/promisekit/git_push.sh | 16 +- .../swift/rxswift/.openapi-generator/VERSION | 2 +- .../Classes/OpenAPIs/APIHelper.swift | 12 +- .../Classes/OpenAPIs/APIs.swift | 27 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 140 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 84 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 152 +- .../OpenAPIs/AlamofireImplementations.swift | 2 +- .../Classes/OpenAPIs/Extensions.swift | 6 +- .../Classes/OpenAPIs/Models.swift | 40 +- .../Classes/OpenAPIs/Models/Category.swift | 5 +- .../Classes/OpenAPIs/Models/Order.swift | 7 +- .../Classes/OpenAPIs/Models/Pet.swift | 7 +- .../Classes/OpenAPIs/Models/Tag.swift | 5 +- .../Classes/OpenAPIs/Models/User.swift | 5 +- .../client/petstore/swift/rxswift/git_push.sh | 16 +- .../swift3/default/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 14 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 206 +-- .../APIs/FakeClassnameTags123API.swift | 12 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 70 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 12 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 52 +- .../Classes/OpenAPIs/Models.swift | 200 +-- .../Models/AdditionalPropertiesClass.swift | 8 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 7 - .../Classes/OpenAPIs/Models/MapTest.swift | 4 - .../petstore/swift3/default/git_push.sh | 14 +- .../objcCompatible/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 14 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 206 +-- .../APIs/FakeClassnameTags123API.swift | 12 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 70 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 12 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 52 +- .../Classes/OpenAPIs/Models.swift | 200 +-- .../Models/AdditionalPropertiesClass.swift | 8 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 7 - .../Classes/OpenAPIs/Models/FormatTest.swift | 5 + .../Classes/OpenAPIs/Models/MapTest.swift | 4 - .../Classes/OpenAPIs/Models/NumberOnly.swift | 5 + .../OpenAPIs/Models/OuterComposite.swift | 5 + .../swift3/objcCompatible/git_push.sh | 14 +- .../promisekit/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 20 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 294 +--- .../APIs/FakeClassnameTags123API.swift | 18 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 100 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 18 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 78 +- .../Classes/OpenAPIs/Models.swift | 200 +-- .../Models/AdditionalPropertiesClass.swift | 8 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 7 - .../Classes/OpenAPIs/Models/MapTest.swift | 4 - .../petstore/swift3/promisekit/git_push.sh | 14 +- .../swift3/rxswift/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 20 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 302 +--- .../APIs/FakeClassnameTags123API.swift | 18 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 102 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 18 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 78 +- .../Classes/OpenAPIs/Models.swift | 200 +-- .../Models/AdditionalPropertiesClass.swift | 8 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 7 - .../Classes/OpenAPIs/Models/MapTest.swift | 4 - .../petstore/swift3/rxswift/git_push.sh | 14 +- .../unwraprequired/.openapi-generator/VERSION | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 14 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 206 +-- .../APIs/FakeClassnameTags123API.swift | 12 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 70 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 12 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 52 +- .../Classes/OpenAPIs/Models.swift | 200 +-- .../Models/AdditionalPropertiesClass.swift | 14 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 10 +- .../Classes/OpenAPIs/Models/MapTest.swift | 8 +- .../swift3/unwraprequired/git_push.sh | 14 +- .../petstore/swift4/default/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 70 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 56 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 28 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 48 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift4/nonPublicApi/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 70 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 56 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 28 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 48 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift4/objcCompatible/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 6 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 72 +- .../APIs/FakeClassnameTags123API.swift | 6 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 58 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 30 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 50 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 6 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 6 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 6 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 6 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 4 +- .../Classes/OpenAPIs/Models/Name.swift | 4 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 6 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 6 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 4 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 6 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 6 +- .../swift4/promisekitLibrary/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 58 +- .../APIs/FakeClassnameTags123API.swift | 2 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 46 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 24 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 36 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift4/resultLibrary/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 86 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 64 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 32 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 60 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift4/rxswiftLibrary/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 48 +- .../APIs/FakeClassnameTags123API.swift | 2 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 38 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 22 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 32 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift4/unwrapRequired/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 70 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 56 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 28 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 48 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 4 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift5/alamofireLibrary/Package.swift | 8 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 56 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 48 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 26 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 36 +- .../OpenAPIs/AlamofireImplementations.swift | 55 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../swift5/combineLibrary/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 34 +- .../APIs/FakeClassnameTags123API.swift | 2 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 30 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 22 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 20 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../petstore/swift5/default/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 56 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 48 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 26 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 36 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/nonPublicApi/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 56 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 48 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 26 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 36 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/objcCompatible/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 6 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 58 +- .../APIs/FakeClassnameTags123API.swift | 6 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 50 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 28 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 38 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 6 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 6 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 6 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 6 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 4 +- .../Classes/OpenAPIs/Models/Name.swift | 4 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 6 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 6 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 4 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 6 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/promisekitLibrary/Package.swift | 8 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 44 +- .../APIs/FakeClassnameTags123API.swift | 2 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 38 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 22 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 24 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/resultLibrary/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 34 +- .../APIs/FakeClassnameTags123API.swift | 2 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 30 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 20 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 20 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/rxswiftLibrary/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 34 +- .../APIs/FakeClassnameTags123API.swift | 2 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 30 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 20 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 20 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/urlsessionLibrary/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 56 +- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 48 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 26 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 36 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../client/test/swift4/default/Package.swift | 6 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../TestClient/Classes/OpenAPIs/APIs.swift | 14 +- .../Classes/OpenAPIs/APIs/Swift4TestAPI.swift | 8 +- .../OpenAPIs/AlamofireImplementations.swift | 29 +- .../Classes/OpenAPIs/CodableHelper.swift | 12 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../OpenAPIs/JSONEncodableEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../TestClient/Classes/OpenAPIs/Models.swift | 4 +- .../OpenAPIs/Models/AllPrimitives.swift | 3 +- .../Classes/OpenAPIs/Models/BaseCard.swift | 3 +- .../Classes/OpenAPIs/Models/ErrorInfo.swift | 3 +- .../OpenAPIs/Models/GetAllModelsResult.swift | 3 +- ...ModelWithIntAdditionalPropertiesOnly.swift | 7 +- ...ithPropertiesAndAdditionalProperties.swift | 6 +- ...elWithStringAdditionalPropertiesOnly.swift | 7 +- .../Classes/OpenAPIs/Models/PersonCard.swift | 3 +- .../OpenAPIs/Models/PersonCardAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/PlaceCard.swift | 3 +- .../OpenAPIs/Models/PlaceCardAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/SampleBase.swift | 3 +- .../OpenAPIs/Models/SampleSubClass.swift | 3 +- .../OpenAPIs/Models/SampleSubClassAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/StringEnum.swift | 1 - .../OpenAPIs/Models/VariableNameTest.swift | 5 +- .../swift4/default/docs/SampleSubClass.md | 2 + .../client/test/swift5/default/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../TestClient/Classes/OpenAPIs/APIs.swift | 14 +- .../Classes/OpenAPIs/APIs/Swift5TestAPI.swift | 8 +- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../TestClient/Classes/OpenAPIs/Models.swift | 7 +- .../OpenAPIs/Models/AllPrimitives.swift | 3 +- .../Classes/OpenAPIs/Models/BaseCard.swift | 3 +- .../Classes/OpenAPIs/Models/ErrorInfo.swift | 3 +- .../OpenAPIs/Models/GetAllModelsResult.swift | 3 +- ...ModelWithIntAdditionalPropertiesOnly.swift | 7 +- ...ithPropertiesAndAdditionalProperties.swift | 6 +- ...elWithStringAdditionalPropertiesOnly.swift | 7 +- .../Classes/OpenAPIs/Models/PersonCard.swift | 3 +- .../OpenAPIs/Models/PersonCardAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/PlaceCard.swift | 3 +- .../OpenAPIs/Models/PlaceCardAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/SampleBase.swift | 3 +- .../OpenAPIs/Models/SampleSubClass.swift | 3 +- .../OpenAPIs/Models/SampleSubClassAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/StringEnum.swift | 1 - .../OpenAPIs/Models/VariableNameTest.swift | 5 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +-- .../swift5/default/docs/SampleSubClass.md | 2 + .../apache2/.openapi-generator/VERSION | 2 +- samples/config/petstore/apache2/PetApi.conf | 10 +- samples/config/petstore/apache2/StoreApi.conf | 6 +- samples/config/petstore/apache2/UserApi.conf | 12 +- .../graphql-schema/.openapi-generator/VERSION | 2 +- .../petstore/api/pet_api.graphql | 2 +- .../petstore/api/store_api.graphql | 2 +- .../petstore/api/user_api.graphql | 2 +- .../petstore/model/api_response.graphql | 2 +- .../petstore/model/category.graphql | 2 +- .../petstore/model/order.graphql | 2 +- .../graphql-schema/petstore/model/pet.graphql | 2 +- .../graphql-schema/petstore/model/tag.graphql | 2 +- .../petstore/model/user.graphql | 2 +- .../.openapi-generator/VERSION | 2 +- .../asciidoc/.openapi-generator/VERSION | 2 +- .../cwiki/.openapi-generator/VERSION | 2 +- .../documentation/cwiki/confluence-markup.txt | 1338 +++++++++-------- .../dynamic-html/.openapi-generator/VERSION | 2 +- .../dynamic-html/docs/operations/PetApi.html | 4 +- .../docs/operations/StoreApi.html | 2 +- .../dynamic-html/docs/operations/UserApi.html | 12 +- .../html.md/.openapi-generator/VERSION | 2 +- samples/documentation/html.md/index.html | 10 +- .../html/.openapi-generator/VERSION | 2 +- samples/documentation/html/index.html | 14 +- .../html2/.openapi-generator/VERSION | 2 +- samples/documentation/html2/index.html | 438 +++--- .../markdown/.openapi-generator/VERSION | 2 +- .../documentation/markdown/Apis/StoreApi.md | 8 +- .../documentation/markdown/Apis/UserApi.md | 12 +- .../aspnetcore/.openapi-generator/VERSION | 2 +- .../cpp-restbed/.openapi-generator/VERSION | 2 +- .../petstore/cpp-restbed/api/PetApi.cpp | 18 +- .../server/petstore/cpp-restbed/api/PetApi.h | 18 +- .../petstore/cpp-restbed/api/StoreApi.cpp | 10 +- .../petstore/cpp-restbed/api/StoreApi.h | 6 +- .../petstore/cpp-restbed/api/UserApi.cpp | 18 +- .../server/petstore/cpp-restbed/api/UserApi.h | 14 +- .../cpp-restbed/model/ApiResponse.cpp | 2 +- .../petstore/cpp-restbed/model/ApiResponse.h | 2 +- .../petstore/cpp-restbed/model/Category.cpp | 2 +- .../petstore/cpp-restbed/model/Category.h | 2 +- .../petstore/cpp-restbed/model/Order.cpp | 2 +- .../server/petstore/cpp-restbed/model/Order.h | 2 +- .../server/petstore/cpp-restbed/model/Pet.cpp | 13 +- .../server/petstore/cpp-restbed/model/Pet.h | 2 +- .../server/petstore/cpp-restbed/model/Tag.cpp | 2 +- .../server/petstore/cpp-restbed/model/Tag.h | 2 +- .../petstore/cpp-restbed/model/User.cpp | 2 +- .../server/petstore/cpp-restbed/model/User.h | 2 +- .../.openapi-generator/VERSION | 2 +- .../fsharp-giraffe/.openapi-generator/VERSION | 2 +- .../OpenAPI/src/api/PetApiHandler.fs | 4 - .../OpenAPI/src/api/PetApiHandlerParams.fs | 14 +- .../OpenAPI/src/impl/PetApiService.fs | 7 - .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java-inflector/.openapi-generator/VERSION | 2 +- .../model/AdditionalPropertiesClass.java | 245 +-- .../java/org/openapitools/model/Animal.java | 2 +- .../openapitools/model/Capitalization.java | 12 +- .../gen/java/org/openapitools/model/Cat.java | 3 +- .../java/org/openapitools/model/Category.java | 6 +- .../org/openapitools/model/ClassModel.java | 2 +- .../java/org/openapitools/model/Client.java | 2 +- .../gen/java/org/openapitools/model/Dog.java | 3 +- .../org/openapitools/model/EnumArrays.java | 6 +- .../org/openapitools/model/EnumClass.java | 2 +- .../java/org/openapitools/model/EnumTest.java | 18 +- .../model/FileSchemaTestClass.java | 2 +- .../org/openapitools/model/FormatTest.java | 54 +- .../openapitools/model/HasOnlyReadOnly.java | 4 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../openapitools/model/Model200Response.java | 4 +- .../openapitools/model/ModelApiResponse.java | 6 +- .../org/openapitools/model/ModelReturn.java | 2 +- .../gen/java/org/openapitools/model/Name.java | 8 +- .../org/openapitools/model/NumberOnly.java | 2 +- .../java/org/openapitools/model/Order.java | 12 +- .../openapitools/model/OuterComposite.java | 6 +- .../org/openapitools/model/OuterEnum.java | 2 +- .../gen/java/org/openapitools/model/Pet.java | 10 +- .../org/openapitools/model/ReadOnlyFirst.java | 4 +- .../openapitools/model/SpecialModelName.java | 2 +- .../gen/java/org/openapitools/model/Tag.java | 4 +- .../gen/java/org/openapitools/model/User.java | 16 +- .../controllers/AnotherFakeController.java | 2 +- .../FakeClassnameTestController.java | 2 +- .../controllers/FakeController.java | 29 +- .../controllers/PetController.java | 4 +- .../controllers/StoreController.java | 2 +- .../controllers/UserController.java | 8 +- .../src/main/openapi/openapi.yaml | 1269 +++++----------- .../java-pkmst/.openapi-generator/VERSION | 2 +- .../com/prokarma/pkmst/controller/PetApi.java | 2 +- .../prokarma/pkmst/controller/StoreApi.java | 2 +- .../prokarma/pkmst/controller/UserApi.java | 2 +- .../app/controllers/FakeApiController.java | 2 +- .../java-undertow/.openapi-generator/VERSION | 2 +- .../main/java/org/openapitools/model/Pet.java | 2 +- .../src/main/resources/config/openapi.json | 760 +++++----- .../rx/.openapi-generator/VERSION | 2 +- .../vertxweb/server/api/PetApi.java | 4 +- .../vertxweb/server/api/PetApiImpl.java | 4 +- .../vertxweb/server/model/Category.java | 2 +- .../vertxweb/server/model/InlineObject.java | 2 +- .../vertxweb/server/model/InlineObject1.java | 2 +- .../server/model/ModelApiResponse.java | 2 +- .../vertxweb/server/model/Order.java | 2 +- .../vertxweb/server/model/Pet.java | 2 +- .../vertxweb/server/model/Tag.java | 2 +- .../vertxweb/server/model/User.java | 2 +- .../rx/src/main/resources/openapi.yaml | 80 +- .../async/.openapi-generator/VERSION | 2 +- .../java-vertx/rx/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java/org/openapitools/api/FakeApi.java | 17 +- .../model/AdditionalPropertiesAnyType.java | 1 - .../model/AdditionalPropertiesArray.java | 1 - .../model/AdditionalPropertiesBoolean.java | 1 - .../model/AdditionalPropertiesClass.java | 7 +- .../model/AdditionalPropertiesInteger.java | 1 - .../model/AdditionalPropertiesNumber.java | 1 - .../model/AdditionalPropertiesObject.java | 1 - .../model/AdditionalPropertiesString.java | 1 - .../java/org/openapitools/model/Animal.java | 2 - .../org/openapitools/model/AnimalFarm.java | 1 - .../model/ArrayOfArrayOfNumberOnly.java | 1 - .../openapitools/model/ArrayOfNumberOnly.java | 1 - .../org/openapitools/model/ArrayTest.java | 1 - .../openapitools/model/Capitalization.java | 1 - .../gen/java/org/openapitools/model/Cat.java | 2 - .../java/org/openapitools/model/Category.java | 1 - .../org/openapitools/model/ClassModel.java | 1 - .../java/org/openapitools/model/Client.java | 1 - .../gen/java/org/openapitools/model/Dog.java | 2 - .../org/openapitools/model/EnumArrays.java | 1 - .../java/org/openapitools/model/EnumTest.java | 1 - .../model/FileSchemaTestClass.java | 3 +- .../org/openapitools/model/FormatTest.java | 29 - .../openapitools/model/HasOnlyReadOnly.java | 1 - .../java/org/openapitools/model/MapTest.java | 1 - ...ropertiesAndAdditionalPropertiesClass.java | 1 - .../openapitools/model/Model200Response.java | 1 - .../openapitools/model/ModelApiResponse.java | 1 - .../org/openapitools/model/ModelReturn.java | 1 - .../gen/java/org/openapitools/model/Name.java | 1 - .../org/openapitools/model/NumberOnly.java | 1 - .../java/org/openapitools/model/Order.java | 1 - .../openapitools/model/OuterComposite.java | 1 - .../gen/java/org/openapitools/model/Pet.java | 3 +- .../org/openapitools/model/ReadOnlyFirst.java | 1 - .../openapitools/model/SpecialModelName.java | 1 - .../openapitools/model/StringBooleanMap.java | 1 - .../gen/java/org/openapitools/model/Tag.java | 1 - .../openapitools/model/TypeHolderDefault.java | 1 - .../openapitools/model/TypeHolderExample.java | 30 - .../gen/java/org/openapitools/model/User.java | 1 - .../java/org/openapitools/model/XmlItem.java | 1 - .../api/impl/AnotherFakeApiServiceImpl.java | 2 +- .../api/impl/FakeApiServiceImpl.java | 11 +- .../FakeClassnameTags123ApiServiceImpl.java | 2 +- .../api/impl/PetApiServiceImpl.java | 2 +- .../api/impl/StoreApiServiceImpl.java | 2 +- .../api/impl/UserApiServiceImpl.java | 2 +- .../src/main/resources/test-data.json | 9 +- .../test-data-control.json | 17 - .../.openapi-generator/VERSION | 2 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 36 +- .../api/FakeClassnameTestApi.java | 2 +- .../gen/java/org/openapitools/api/PetApi.java | 13 +- .../java/org/openapitools/api/StoreApi.java | 2 +- .../java/org/openapitools/api/UserApi.java | 8 +- .../model/AdditionalPropertiesClass.java | 223 +-- .../java/org/openapitools/model/Animal.java | 10 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../openapitools/model/ArrayOfNumberOnly.java | 2 +- .../org/openapitools/model/ArrayTest.java | 6 +- .../openapitools/model/Capitalization.java | 12 +- .../gen/java/org/openapitools/model/Cat.java | 6 +- .../java/org/openapitools/model/Category.java | 9 +- .../org/openapitools/model/ClassModel.java | 3 +- .../java/org/openapitools/model/Client.java | 2 +- .../gen/java/org/openapitools/model/Dog.java | 6 +- .../org/openapitools/model/EnumArrays.java | 16 +- .../org/openapitools/model/EnumClass.java | 6 +- .../java/org/openapitools/model/EnumTest.java | 36 +- .../model/FileSchemaTestClass.java | 6 +- .../org/openapitools/model/FormatTest.java | 50 +- .../openapitools/model/HasOnlyReadOnly.java | 4 +- .../java/org/openapitools/model/MapTest.java | 23 +- ...ropertiesAndAdditionalPropertiesClass.java | 6 +- .../openapitools/model/Model200Response.java | 5 +- .../openapitools/model/ModelApiResponse.java | 6 +- .../org/openapitools/model/ModelReturn.java | 3 +- .../gen/java/org/openapitools/model/Name.java | 9 +- .../org/openapitools/model/NumberOnly.java | 2 +- .../java/org/openapitools/model/Order.java | 18 +- .../openapitools/model/OuterComposite.java | 6 +- .../org/openapitools/model/OuterEnum.java | 6 +- .../gen/java/org/openapitools/model/Pet.java | 20 +- .../org/openapitools/model/ReadOnlyFirst.java | 4 +- .../openapitools/model/SpecialModelName.java | 2 +- .../gen/java/org/openapitools/model/Tag.java | 4 +- .../gen/java/org/openapitools/model/User.java | 16 +- .../src/main/openapi/openapi.yaml | 1325 +++++----------- .../.openapi-generator/VERSION | 2 +- .../build.gradle.kts | 6 +- .../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 +- .../kotlin/vertx/.openapi-generator/VERSION | 2 +- .../org/openapitools/server/api/model/Pet.kt | 4 +- .../nancyfx-async/.openapi-generator/VERSION | 2 +- .../nancyfx/.openapi-generator/VERSION | 2 +- .../Org.OpenAPITools/Models/ApiResponse.cs | 2 +- .../src/Org.OpenAPITools/Models/Category.cs | 2 +- .../src/Org.OpenAPITools/Models/Order.cs | 10 +- .../src/Org.OpenAPITools/Models/Pet.cs | 2 +- .../src/Org.OpenAPITools/Models/Tag.cs | 2 +- .../src/Org.OpenAPITools/Models/User.cs | 2 +- .../src/Org.OpenAPITools/Modules/PetModule.cs | 38 +- .../Org.OpenAPITools/Modules/StoreModule.cs | 22 +- .../Org.OpenAPITools/Modules/UserModule.cs | 70 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../Utils/LocalDateConverter.cs | 2 +- .../src/Org.OpenAPITools/Utils/Parameters.cs | 2 +- .../.openapi-generator/VERSION | 2 +- .../nodejs-express-server/api/openapi.yaml | 62 +- .../php-laravel/.openapi-generator/VERSION | 2 +- .../app/Http/Controllers/FakeController.php | 46 +- .../php-laravel/lib/app/Models/FormatTest.php | 3 - .../lib/app/Models/TypeHolderExample.php | 3 - .../petstore/php-laravel/lib/routes/api.php | 11 +- .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../petstore/python-blueplanet/README.md | 59 + .../python-blueplanet/requirements.txt | 2 + .../ruby-on-rails/.openapi-generator/VERSION | 2 +- .../ruby-on-rails/db/migrate/0_init_tables.rb | 14 + .../ruby-sinatra/.openapi-generator/VERSION | 2 +- .../server/petstore/ruby-sinatra/openapi.yaml | 256 ++-- .../org/openapitools/server/api/PetApi.scala | 12 +- .../openapitools/server/api/StoreApi.scala | 4 +- .../org/openapitools/server/api/UserApi.scala | 16 +- 1637 files changed, 9840 insertions(+), 15955 deletions(-) create mode 100644 samples/server/petstore/python-blueplanet/.openapi-generator-ignore create mode 100644 samples/server/petstore/python-blueplanet/.openapi-generator/VERSION create mode 100644 samples/server/petstore/python-blueplanet/README.md create mode 100644 samples/server/petstore/python-blueplanet/requirements.txt diff --git a/samples/client/petstore/ada/.openapi-generator/VERSION b/samples/client/petstore/ada/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/client/petstore/ada/.openapi-generator/VERSION +++ b/samples/client/petstore/ada/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ada/src/client/samples-petstore-clients.adb b/samples/client/petstore/ada/src/client/samples-petstore-clients.adb index add37b0b16d7..1920cbf1fe40 100644 --- a/samples/client/petstore/ada/src/client/samples-petstore-clients.adb +++ b/samples/client/petstore/ada/src/client/samples-petstore-clients.adb @@ -4,7 +4,7 @@ -- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.2.3-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. diff --git a/samples/client/petstore/ada/src/client/samples-petstore-clients.ads b/samples/client/petstore/ada/src/client/samples-petstore-clients.ads index 6bf3f7c8b878..adc6a3c692ab 100644 --- a/samples/client/petstore/ada/src/client/samples-petstore-clients.ads +++ b/samples/client/petstore/ada/src/client/samples-petstore-clients.ads @@ -4,7 +4,7 @@ -- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.2.3-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. diff --git a/samples/client/petstore/ada/src/model/samples-petstore-models.adb b/samples/client/petstore/ada/src/model/samples-petstore-models.adb index b4bcabf6d4d6..db3f9463478e 100644 --- a/samples/client/petstore/ada/src/model/samples-petstore-models.adb +++ b/samples/client/petstore/ada/src/model/samples-petstore-models.adb @@ -4,7 +4,7 @@ -- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.2.3-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. diff --git a/samples/client/petstore/ada/src/model/samples-petstore-models.ads b/samples/client/petstore/ada/src/model/samples-petstore-models.ads index d27afd7bcdae..4b0e867aa076 100644 --- a/samples/client/petstore/ada/src/model/samples-petstore-models.ads +++ b/samples/client/petstore/ada/src/model/samples-petstore-models.ads @@ -4,7 +4,7 @@ -- The version of the OpenAPI document: 1.0.0 -- -- --- NOTE: This package is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. +-- NOTE: This package is auto generated by OpenAPI-Generator 4.2.3-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. diff --git a/samples/client/petstore/android/httpclient/.openapi-generator/VERSION b/samples/client/petstore/android/httpclient/.openapi-generator/VERSION index bfbf77eb7fad..afa636560641 100644 --- a/samples/client/petstore/android/httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/android/httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/android/httpclient/README.md b/samples/client/petstore/android/httpclient/README.md index 325ce22b90c8..309ba5d78118 100644 --- a/samples/client/petstore/android/httpclient/README.md +++ b/samples/client/petstore/android/httpclient/README.md @@ -49,8 +49,8 @@ At first generate the JAR by executing: Then manually install the following JARs: -- target/openapi-android-client-1.0.0.jar -- target/lib/*.jar +* target/openapi-android-client-1.0.0.jar +* target/lib/*.jar ## Getting Started @@ -64,9 +64,9 @@ public class PetApiExample { public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -120,13 +120,11 @@ Authentication schemes defined for the API: ### api_key - **Type**: API key - - **API key parameter name**: api_key - **Location**: HTTP header ### petstore_auth - - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/android/httpclient/build.gradle b/samples/client/petstore/android/httpclient/build.gradle index 7e9fd7b30bef..6be898ef01d9 100644 --- a/samples/client/petstore/android/httpclient/build.gradle +++ b/samples/client/petstore/android/httpclient/build.gradle @@ -3,7 +3,7 @@ project.version = '1.0.0' buildscript { repositories { - maven { url "https://repo1.maven.org/maven2" } + mavenCentral() jcenter() } dependencies { diff --git a/samples/client/petstore/android/httpclient/docs/ApiResponse.md b/samples/client/petstore/android/httpclient/docs/ApiResponse.md index a169bf232e15..1c17767c2b72 100644 --- a/samples/client/petstore/android/httpclient/docs/ApiResponse.md +++ b/samples/client/petstore/android/httpclient/docs/ApiResponse.md @@ -1,9 +1,7 @@ - # ApiResponse ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **Integer** | | [optional] @@ -12,4 +10,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/httpclient/docs/Category.md b/samples/client/petstore/android/httpclient/docs/Category.md index 53c9fedc8bc4..e2df08032787 100644 --- a/samples/client/petstore/android/httpclient/docs/Category.md +++ b/samples/client/petstore/android/httpclient/docs/Category.md @@ -1,9 +1,7 @@ - # Category ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -11,4 +9,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/httpclient/docs/Order.md b/samples/client/petstore/android/httpclient/docs/Order.md index f49e8704e088..5746ce97fad3 100644 --- a/samples/client/petstore/android/httpclient/docs/Order.md +++ b/samples/client/petstore/android/httpclient/docs/Order.md @@ -1,9 +1,7 @@ - # Order ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -14,11 +12,10 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum - Name | Value ---- | ----- - diff --git a/samples/client/petstore/android/httpclient/docs/Pet.md b/samples/client/petstore/android/httpclient/docs/Pet.md index 72e3338dfb83..a4daa24feb60 100644 --- a/samples/client/petstore/android/httpclient/docs/Pet.md +++ b/samples/client/petstore/android/httpclient/docs/Pet.md @@ -1,9 +1,7 @@ - # Pet ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -14,11 +12,10 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum - Name | Value ---- | ----- - diff --git a/samples/client/petstore/android/httpclient/docs/PetApi.md b/samples/client/petstore/android/httpclient/docs/PetApi.md index 4f91f08bc476..7cf076f29c58 100644 --- a/samples/client/petstore/android/httpclient/docs/PetApi.md +++ b/samples/client/petstore/android/httpclient/docs/PetApi.md @@ -14,23 +14,21 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - -## addPet - -> addPet(body) + +# **addPet** +> addPet(pet) Add a new pet to the store ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -39,10 +37,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -54,18 +51,16 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## deletePet + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +# **deletePet** > deletePet(petId, apiKey) Deletes a pet ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -83,7 +78,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| Pet id to delete | [default to null] @@ -99,12 +93,11 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## findPetsByStatus + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **findPetsByStatus** > List<Pet> findPetsByStatus(status) Finds Pets by status @@ -112,7 +105,6 @@ Finds Pets by status Multiple status values can be provided with comma separated strings ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -130,7 +122,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] @@ -145,12 +136,11 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## findPetsByTags + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **findPetsByTags** > List<Pet> findPetsByTags(tags) Finds Pets by tags @@ -158,7 +148,6 @@ Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -176,7 +165,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to null] @@ -191,12 +179,11 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## getPetById + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **getPetById** > Pet getPetById(petId) Find pet by ID @@ -204,7 +191,6 @@ Find pet by ID Returns a single pet ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -222,7 +208,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to return | [default to null] @@ -237,26 +222,24 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json - -## updatePet - -> updatePet(body) + +# **updatePet** +> updatePet(pet) Update an existing pet ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -265,10 +248,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -280,18 +262,16 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## updatePetWithForm + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +# **updatePetWithForm** > updatePetWithForm(petId, name, status) Updates a pet in the store with form data ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -310,7 +290,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet that needs to be updated | [default to null] @@ -327,18 +306,16 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - - -## uploadFile + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +# **uploadFile** > ApiResponse uploadFile(petId, additionalMetadata, file) uploads an image ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -358,7 +335,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | [default to null] @@ -375,6 +351,6 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: multipart/form-data -- **Accept**: application/json + - **Content-Type**: multipart/form-data + - **Accept**: application/json diff --git a/samples/client/petstore/android/httpclient/docs/StoreApi.md b/samples/client/petstore/android/httpclient/docs/StoreApi.md index d2229bfd71f4..b768ad5ba986 100644 --- a/samples/client/petstore/android/httpclient/docs/StoreApi.md +++ b/samples/client/petstore/android/httpclient/docs/StoreApi.md @@ -10,9 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - -## deleteOrder - + +# **deleteOrder** > deleteOrder(orderId) Delete purchase order by ID @@ -20,7 +19,6 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -37,7 +35,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **String**| ID of the order that needs to be deleted | [default to null] @@ -52,12 +49,11 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## getInventory + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **getInventory** > Map<String, Integer> getInventory() Returns pet inventories by status @@ -65,7 +61,6 @@ Returns pet inventories by status Returns a map of status codes to quantities ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -81,7 +76,6 @@ try { ``` ### Parameters - This endpoint does not need any parameter. ### Return type @@ -94,12 +88,11 @@ This endpoint does not need any parameter. ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/json - - -## getOrderById + - **Content-Type**: Not defined + - **Accept**: application/json + +# **getOrderById** > Order getOrderById(orderId) Find purchase order by ID @@ -107,7 +100,6 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -125,7 +117,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **Long**| ID of pet that needs to be fetched | [default to null] @@ -140,26 +131,24 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json - -## placeOrder - -> Order placeOrder(body) + +# **placeOrder** +> Order placeOrder(order) Place an order for a pet ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -169,10 +158,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -184,6 +172,6 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json diff --git a/samples/client/petstore/android/httpclient/docs/Tag.md b/samples/client/petstore/android/httpclient/docs/Tag.md index b540cab453f0..de6814b55d57 100644 --- a/samples/client/petstore/android/httpclient/docs/Tag.md +++ b/samples/client/petstore/android/httpclient/docs/Tag.md @@ -1,9 +1,7 @@ - # Tag ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -11,4 +9,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/httpclient/docs/User.md b/samples/client/petstore/android/httpclient/docs/User.md index 5e51c05150c8..8b6753dd284a 100644 --- a/samples/client/petstore/android/httpclient/docs/User.md +++ b/samples/client/petstore/android/httpclient/docs/User.md @@ -1,9 +1,7 @@ - # User ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -17,4 +15,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/httpclient/docs/UserApi.md b/samples/client/petstore/android/httpclient/docs/UserApi.md index 4c54ee4c77c6..e5a16428112e 100644 --- a/samples/client/petstore/android/httpclient/docs/UserApi.md +++ b/samples/client/petstore/android/httpclient/docs/UserApi.md @@ -14,25 +14,23 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - -## createUser - -> createUser(body) + +# **createUser** +> createUser(user) Create user This can only be done by the logged in user. ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -41,10 +39,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,26 +53,24 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined - -## createUsersWithArrayInput - -> createUsersWithArrayInput(body) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) Creates list of users with given input array ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -84,10 +79,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -99,26 +93,24 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined - -## createUsersWithListInput - -> createUsersWithListInput(body) + +# **createUsersWithListInput** +> createUsersWithListInput(user) Creates list of users with given input array ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -127,10 +119,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -142,12 +133,11 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## deleteUser + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **deleteUser** > deleteUser(username) Delete user @@ -155,7 +145,6 @@ Delete user This can only be done by the logged in user. ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -172,7 +161,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be deleted | [default to null] @@ -187,18 +175,16 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## getUserByName + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **getUserByName** > User getUserByName(username) Get user by user name ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -216,7 +202,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] @@ -231,18 +216,16 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## loginUser + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **loginUser** > String loginUser(username, password) Logs user into the system ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -261,7 +244,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The user name for login | [default to null] @@ -277,18 +259,16 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## logoutUser + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **logoutUser** > logoutUser() Logs out current logged in user session ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -303,7 +283,6 @@ try { ``` ### Parameters - This endpoint does not need any parameter. ### Return type @@ -316,29 +295,27 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined - -## updateUser - -> updateUser(username, body) + +# **updateUser** +> updateUser(username, user) Updated user This can only be done by the logged in user. ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); String username = null; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -347,11 +324,10 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -363,6 +339,6 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined diff --git a/samples/client/petstore/android/httpclient/git_push.sh b/samples/client/petstore/android/httpclient/git_push.sh index ced3be2b0c7b..20057f67ade4 100644 --- a/samples/client/petstore/android/httpclient/git_push.sh +++ b/samples/client/petstore/android/httpclient/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java index 2e0db8b1bf70..7e9a6ef4d562 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java index fd1eba49be83..18403b1972c6 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java index 5f6c62e79d8a..33fd7b63bd2a 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java index 062883523107..21a436455a1d 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java index 361994a058f0..10e4466ae0b2 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -53,14 +53,14 @@ public String getBasePath() { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @return void */ - public void addPet (Pet body) throws ApiException { - Object localVarPostBody = body; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling addPet"); + public void addPet (Pet pet) throws ApiException { + Object localVarPostBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); } // create path and map variables @@ -317,14 +317,14 @@ public Pet getPetById (Long petId) throws ApiException { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @return void */ - public void updatePet (Pet body) throws ApiException { - Object localVarPostBody = body; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet"); + public void updatePet (Pet pet) throws ApiException { + Object localVarPostBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); } // create path and map variables diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java index 17ad5b2c0840..91dadd5646da 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -203,14 +203,14 @@ public Order getOrderById (Long orderId) throws ApiException { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet * @return Order */ - public Order placeOrder (Order body) throws ApiException { - Object localVarPostBody = body; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder"); + public Order placeOrder (Order order) throws ApiException { + Object localVarPostBody = order; + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); } // create path and map variables diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java index c6a854dec579..6189aff41a38 100644 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -52,14 +52,14 @@ public String getBasePath() { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object * @return void */ - public void createUser (User body) throws ApiException { - Object localVarPostBody = body; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUser"); + public void createUser (User user) throws ApiException { + Object localVarPostBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); } // create path and map variables @@ -104,14 +104,14 @@ public void createUser (User body) throws ApiException { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object * @return void */ - public void createUsersWithArrayInput (List body) throws ApiException { - Object localVarPostBody = body; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); + public void createUsersWithArrayInput (List user) throws ApiException { + Object localVarPostBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } // create path and map variables @@ -156,14 +156,14 @@ public void createUsersWithArrayInput (List body) throws ApiException { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object * @return void */ - public void createUsersWithListInput (List body) throws ApiException { - Object localVarPostBody = body; - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"); + public void createUsersWithListInput (List user) throws ApiException { + Object localVarPostBody = user; + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); } // create path and map variables @@ -419,18 +419,18 @@ public void logoutUser () throws ApiException { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object * @return void */ - public void updateUser (String username, User body) throws ApiException { - Object localVarPostBody = body; + public void updateUser (String username, User user) throws ApiException { + Object localVarPostBody = user; // verify the required parameter 'username' is set if (username == null) { throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser"); + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); } // create path and map variables diff --git a/samples/client/petstore/android/volley/.openapi-generator/VERSION b/samples/client/petstore/android/volley/.openapi-generator/VERSION index bfbf77eb7fad..afa636560641 100644 --- a/samples/client/petstore/android/volley/.openapi-generator/VERSION +++ b/samples/client/petstore/android/volley/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/android/volley/README.md b/samples/client/petstore/android/volley/README.md index d4f8c7a7f174..c2fca9e2b9eb 100644 --- a/samples/client/petstore/android/volley/README.md +++ b/samples/client/petstore/android/volley/README.md @@ -49,8 +49,8 @@ At first generate the JAR by executing: Then manually install the following JARs: -- target/petstore-android-volley-1.0.0.jar -- target/lib/*.jar +* target/petstore-android-volley-1.0.0.jar +* target/lib/*.jar ## Getting Started @@ -64,9 +64,9 @@ public class PetApiExample { public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -120,13 +120,11 @@ Authentication schemes defined for the API: ### api_key - **Type**: API key - - **API key parameter name**: api_key - **Location**: HTTP header ### petstore_auth - - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/android/volley/build.gradle b/samples/client/petstore/android/volley/build.gradle index 215e7832c483..b3a4c135c03f 100644 --- a/samples/client/petstore/android/volley/build.gradle +++ b/samples/client/petstore/android/volley/build.gradle @@ -3,7 +3,7 @@ project.version = '1.0.0' buildscript { repositories { - maven { url "https://repo1.maven.org/maven2" } + mavenCentral() jcenter() } dependencies { diff --git a/samples/client/petstore/android/volley/docs/ApiResponse.md b/samples/client/petstore/android/volley/docs/ApiResponse.md index a169bf232e15..1c17767c2b72 100644 --- a/samples/client/petstore/android/volley/docs/ApiResponse.md +++ b/samples/client/petstore/android/volley/docs/ApiResponse.md @@ -1,9 +1,7 @@ - # ApiResponse ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **Integer** | | [optional] @@ -12,4 +10,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/volley/docs/Category.md b/samples/client/petstore/android/volley/docs/Category.md index 53c9fedc8bc4..e2df08032787 100644 --- a/samples/client/petstore/android/volley/docs/Category.md +++ b/samples/client/petstore/android/volley/docs/Category.md @@ -1,9 +1,7 @@ - # Category ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -11,4 +9,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/volley/docs/Order.md b/samples/client/petstore/android/volley/docs/Order.md index f49e8704e088..5746ce97fad3 100644 --- a/samples/client/petstore/android/volley/docs/Order.md +++ b/samples/client/petstore/android/volley/docs/Order.md @@ -1,9 +1,7 @@ - # Order ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -14,11 +12,10 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum - Name | Value ---- | ----- - diff --git a/samples/client/petstore/android/volley/docs/Pet.md b/samples/client/petstore/android/volley/docs/Pet.md index 72e3338dfb83..a4daa24feb60 100644 --- a/samples/client/petstore/android/volley/docs/Pet.md +++ b/samples/client/petstore/android/volley/docs/Pet.md @@ -1,9 +1,7 @@ - # Pet ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -14,11 +12,10 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum - Name | Value ---- | ----- - diff --git a/samples/client/petstore/android/volley/docs/PetApi.md b/samples/client/petstore/android/volley/docs/PetApi.md index 4f91f08bc476..7cf076f29c58 100644 --- a/samples/client/petstore/android/volley/docs/PetApi.md +++ b/samples/client/petstore/android/volley/docs/PetApi.md @@ -14,23 +14,21 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - -## addPet - -> addPet(body) + +# **addPet** +> addPet(pet) Add a new pet to the store ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -39,10 +37,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -54,18 +51,16 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## deletePet + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +# **deletePet** > deletePet(petId, apiKey) Deletes a pet ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -83,7 +78,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| Pet id to delete | [default to null] @@ -99,12 +93,11 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## findPetsByStatus + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **findPetsByStatus** > List<Pet> findPetsByStatus(status) Finds Pets by status @@ -112,7 +105,6 @@ Finds Pets by status Multiple status values can be provided with comma separated strings ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -130,7 +122,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] @@ -145,12 +136,11 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## findPetsByTags + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **findPetsByTags** > List<Pet> findPetsByTags(tags) Finds Pets by tags @@ -158,7 +148,6 @@ Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -176,7 +165,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to null] @@ -191,12 +179,11 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## getPetById + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **getPetById** > Pet getPetById(petId) Find pet by ID @@ -204,7 +191,6 @@ Find pet by ID Returns a single pet ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -222,7 +208,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to return | [default to null] @@ -237,26 +222,24 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json - -## updatePet - -> updatePet(body) + +# **updatePet** +> updatePet(pet) Update an existing pet ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store +Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -265,10 +248,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -280,18 +262,16 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - - -## updatePetWithForm + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +# **updatePetWithForm** > updatePetWithForm(petId, name, status) Updates a pet in the store with form data ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -310,7 +290,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet that needs to be updated | [default to null] @@ -327,18 +306,16 @@ null (empty response body) ### HTTP request headers -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - - -## uploadFile + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +# **uploadFile** > ApiResponse uploadFile(petId, additionalMetadata, file) uploads an image ### Example - ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -358,7 +335,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | [default to null] @@ -375,6 +351,6 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: multipart/form-data -- **Accept**: application/json + - **Content-Type**: multipart/form-data + - **Accept**: application/json diff --git a/samples/client/petstore/android/volley/docs/StoreApi.md b/samples/client/petstore/android/volley/docs/StoreApi.md index d2229bfd71f4..b768ad5ba986 100644 --- a/samples/client/petstore/android/volley/docs/StoreApi.md +++ b/samples/client/petstore/android/volley/docs/StoreApi.md @@ -10,9 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - -## deleteOrder - + +# **deleteOrder** > deleteOrder(orderId) Delete purchase order by ID @@ -20,7 +19,6 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -37,7 +35,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **String**| ID of the order that needs to be deleted | [default to null] @@ -52,12 +49,11 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## getInventory + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **getInventory** > Map<String, Integer> getInventory() Returns pet inventories by status @@ -65,7 +61,6 @@ Returns pet inventories by status Returns a map of status codes to quantities ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -81,7 +76,6 @@ try { ``` ### Parameters - This endpoint does not need any parameter. ### Return type @@ -94,12 +88,11 @@ This endpoint does not need any parameter. ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/json - - -## getOrderById + - **Content-Type**: Not defined + - **Accept**: application/json + +# **getOrderById** > Order getOrderById(orderId) Find purchase order by ID @@ -107,7 +100,6 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -125,7 +117,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **Long**| ID of pet that needs to be fetched | [default to null] @@ -140,26 +131,24 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json - -## placeOrder - -> Order placeOrder(body) + +# **placeOrder** +> Order placeOrder(order) Place an order for a pet ### Example - ```java // Import classes: //import org.openapitools.client.api.StoreApi; StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet +Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -169,10 +158,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -184,6 +172,6 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json diff --git a/samples/client/petstore/android/volley/docs/Tag.md b/samples/client/petstore/android/volley/docs/Tag.md index b540cab453f0..de6814b55d57 100644 --- a/samples/client/petstore/android/volley/docs/Tag.md +++ b/samples/client/petstore/android/volley/docs/Tag.md @@ -1,9 +1,7 @@ - # Tag ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -11,4 +9,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/volley/docs/User.md b/samples/client/petstore/android/volley/docs/User.md index 5e51c05150c8..8b6753dd284a 100644 --- a/samples/client/petstore/android/volley/docs/User.md +++ b/samples/client/petstore/android/volley/docs/User.md @@ -1,9 +1,7 @@ - # User ## Properties - Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -17,4 +15,3 @@ Name | Type | Description | Notes - diff --git a/samples/client/petstore/android/volley/docs/UserApi.md b/samples/client/petstore/android/volley/docs/UserApi.md index 4c54ee4c77c6..e5a16428112e 100644 --- a/samples/client/petstore/android/volley/docs/UserApi.md +++ b/samples/client/petstore/android/volley/docs/UserApi.md @@ -14,25 +14,23 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - -## createUser - -> createUser(body) + +# **createUser** +> createUser(user) Create user This can only be done by the logged in user. ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object +User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -41,10 +39,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -56,26 +53,24 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined - -## createUsersWithArrayInput - -> createUsersWithArrayInput(body) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) Creates list of users with given input array ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -84,10 +79,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -99,26 +93,24 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined - -## createUsersWithListInput - -> createUsersWithListInput(body) + +# **createUsersWithListInput** +> createUsersWithListInput(user) Creates list of users with given input array ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object +List user = Arrays.asList(new List()); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -127,10 +119,9 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -142,12 +133,11 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## deleteUser + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **deleteUser** > deleteUser(username) Delete user @@ -155,7 +145,6 @@ Delete user This can only be done by the logged in user. ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -172,7 +161,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be deleted | [default to null] @@ -187,18 +175,16 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## getUserByName + - **Content-Type**: Not defined + - **Accept**: Not defined + +# **getUserByName** > User getUserByName(username) Get user by user name ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -216,7 +202,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] @@ -231,18 +216,16 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## loginUser + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **loginUser** > String loginUser(username, password) Logs user into the system ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -261,7 +244,6 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The user name for login | [default to null] @@ -277,18 +259,16 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - - -## logoutUser + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +# **logoutUser** > logoutUser() Logs out current logged in user session ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -303,7 +283,6 @@ try { ``` ### Parameters - This endpoint does not need any parameter. ### Return type @@ -316,29 +295,27 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined - -## updateUser - -> updateUser(username, body) + +# **updateUser** +> updateUser(username, user) Updated user This can only be done by the logged in user. ### Example - ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); String username = null; // String | name that need to be deleted -User body = new User(); // User | Updated user object +User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -347,11 +324,10 @@ try { ### Parameters - Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -363,6 +339,6 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined + - **Content-Type**: Not defined + - **Accept**: Not defined diff --git a/samples/client/petstore/android/volley/git_push.sh b/samples/client/petstore/android/volley/git_push.sh index ced3be2b0c7b..0f406ef78782 100644 --- a/samples/client/petstore/android/volley/git_push.sh +++ b/samples/client/petstore/android/volley/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,5 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/android/volley/pom.xml b/samples/client/petstore/android/volley/pom.xml index 19765ff2968f..800d148e4df3 100644 --- a/samples/client/petstore/android/volley/pom.xml +++ b/samples/client/petstore/android/volley/pom.xml @@ -11,12 +11,6 @@ swagger-annotations ${swagger-annotations-version} - - - com.google.code.findbugs - jsr305 - 3.0.2 - org.apache.httpcomponents httpcore diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java index 2f57c83eeb73..70f3b77ceead 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java index 9ff0422de5f9..2e7ab447cf3d 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java index c52b2dcd70d3..3cdc69558e3d 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java index d358fcf66b45..e8f34f395f89 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java index a80910cd4c89..f90cf9d21e36 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -60,15 +60,15 @@ public String getBasePath() { /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @return void */ - public void addPet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", - new ApiException(400, "Missing the required parameter 'body' when calling addPet")); + public void addPet (Pet pet) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling addPet", + new ApiException(400, "Missing the required parameter 'pet' when calling addPet")); } // create path and map variables @@ -124,15 +124,15 @@ public void addPet (Pet body) throws TimeoutException, ExecutionException, Inter /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public void addPet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void addPet (Pet pet, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", - new ApiException(400, "Missing the required parameter 'body' when calling addPet")); + // verify the required parameter 'pet' is set + if (pet == null) { + VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling addPet", + new ApiException(400, "Missing the required parameter 'pet' when calling addPet")); } // create path and map variables @@ -696,15 +696,15 @@ public void onErrorResponse(VolleyError error) { /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @return void */ - public void updatePet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", - new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); + public void updatePet (Pet pet) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = pet; + // verify the required parameter 'pet' is set + if (pet == null) { + VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling updatePet", + new ApiException(400, "Missing the required parameter 'pet' when calling updatePet")); } // create path and map variables @@ -760,15 +760,15 @@ public void updatePet (Pet body) throws TimeoutException, ExecutionException, In /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store */ - public void updatePet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void updatePet (Pet pet, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = pet; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", - new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); + // verify the required parameter 'pet' is set + if (pet == null) { + VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling updatePet", + new ApiException(400, "Missing the required parameter 'pet' when calling updatePet")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java index fd69b7573487..3da1f3f76896 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -425,15 +425,15 @@ public void onErrorResponse(VolleyError error) { /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet * @return Order */ - public Order placeOrder (Order body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", - new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); + public Order placeOrder (Order order) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = order; + // verify the required parameter 'order' is set + if (order == null) { + VolleyError error = new VolleyError("Missing the required parameter 'order' when calling placeOrder", + new ApiException(400, "Missing the required parameter 'order' when calling placeOrder")); } // create path and map variables @@ -487,15 +487,15 @@ public Order placeOrder (Order body) throws TimeoutException, ExecutionException /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet */ - public void placeOrder (Order body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void placeOrder (Order order, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = order; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", - new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); + // verify the required parameter 'order' is set + if (order == null) { + VolleyError error = new VolleyError("Missing the required parameter 'order' when calling placeOrder", + new ApiException(400, "Missing the required parameter 'order' when calling placeOrder")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java index edec8bce95e9..ce88777ae1ca 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -59,15 +59,15 @@ public String getBasePath() { /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object * @return void */ - public void createUser (User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", - new ApiException(400, "Missing the required parameter 'body' when calling createUser")); + public void createUser (User user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUser", + new ApiException(400, "Missing the required parameter 'user' when calling createUser")); } // create path and map variables @@ -121,15 +121,15 @@ public void createUser (User body) throws TimeoutException, ExecutionException, /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object */ - public void createUser (User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void createUser (User user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = user; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", - new ApiException(400, "Missing the required parameter 'body' when calling createUser")); + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUser", + new ApiException(400, "Missing the required parameter 'user' when calling createUser")); } // create path and map variables @@ -182,15 +182,15 @@ public void onErrorResponse(VolleyError error) { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object * @return void */ - public void createUsersWithArrayInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", - new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); + public void createUsersWithArrayInput (List user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput")); } // create path and map variables @@ -244,15 +244,15 @@ public void createUsersWithArrayInput (List body) throws TimeoutException, /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public void createUsersWithArrayInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void createUsersWithArrayInput (List user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = user; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", - new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput")); } // create path and map variables @@ -305,15 +305,15 @@ public void onErrorResponse(VolleyError error) { /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object * @return void */ - public void createUsersWithListInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", - new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); + public void createUsersWithListInput (List user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = user; + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput")); } // create path and map variables @@ -367,15 +367,15 @@ public void createUsersWithListInput (List body) throws TimeoutException, /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object */ - public void createUsersWithListInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void createUsersWithListInput (List user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = user; - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", - new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput")); } // create path and map variables @@ -933,20 +933,20 @@ public void onErrorResponse(VolleyError error) { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object * @return void */ - public void updateUser (String username, User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = body; + public void updateUser (String username, User user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = user; // verify the required parameter 'username' is set if (username == null) { VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); } - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", - new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling updateUser", + new ApiException(400, "Missing the required parameter 'user' when calling updateUser")); } // create path and map variables @@ -1000,20 +1000,20 @@ public void updateUser (String username, User body) throws TimeoutException, Exe /** * Updated user * This can only be done by the logged in user. - * @param username name that need to be deleted * @param body Updated user object + * @param username name that need to be deleted * @param user Updated user object */ - public void updateUser (String username, User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = body; + public void updateUser (String username, User user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = user; // verify the required parameter 'username' is set if (username == null) { VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); } - // verify the required parameter 'body' is set - if (body == null) { - VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", - new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); + // verify the required parameter 'user' is set + if (user == null) { + VolleyError error = new VolleyError("Missing the required parameter 'user' when calling updateUser", + new ApiException(400, "Missing the required parameter 'user' when calling updateUser")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index fe6364d31729..b15bbd4de9d6 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java index 2eec51b72b97..7ea7f36402c6 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 1226b62d5b2b..8b66fa172161 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java index 82d2c3031356..00254f1548aa 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java index 25016438a568..cd1473811a1c 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java index b5958b2eb652..6d4ba799ea4f 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java index b8fa5f5b48c3..71026c8fdc40 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java index c61264d3c9c3..dd37b76de2fb 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java index 757cc8fed0a3..268f152e1d56 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java index 387e52f102c0..d4143bbe63d5 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java index dd2c824098c0..4c87ff45bd7b 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java index 4f97af9d06d9..909c4ea18a07 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java index dd4c40ddc85d..229891e581d3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java index 877d4855c440..70da15b48d96 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * The version of the OpenAPI document: 1.0.0 + * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/bash/.openapi-generator/VERSION b/samples/client/petstore/bash/.openapi-generator/VERSION index bfbf77eb7fad..e4955748d3e7 100644 --- a/samples/client/petstore/bash/.openapi-generator/VERSION +++ b/samples/client/petstore/bash/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/bash/Dockerfile b/samples/client/petstore/bash/Dockerfile index ee17f324a5c9..77df27f36614 100644 --- a/samples/client/petstore/bash/Dockerfile +++ b/samples/client/petstore/bash/Dockerfile @@ -41,6 +41,7 @@ $(tput setaf 3)PETSTORE_HOST$(tput sgr0) - server URL, e.g. https://example.com: $(tput setaf 3)PETSTORE_API_KEY$(tput sgr0) - access token, e.g. "ASDASHJDG63456asdASSD"\n\ $(tput setaf 3)PETSTORE_API_KEY$(tput sgr0) - access token, e.g. "ASDASHJDG63456asdASSD"\n\ $(tput setaf 3)PETSTORE_BASIC_AUTH$(tput sgr0) - basic authentication credentials, e.g.: "username:password"\n\ +$(tput setaf 3)PETSTORE_BASIC_AUTH$(tput sgr0) - basic authentication credentials, e.g.: "username:password"\n\ \n\ $(tput setaf 7)Basic usage:$(tput sgr0)\n\ \n\ diff --git a/samples/client/petstore/bash/README.md b/samples/client/petstore/bash/README.md index 242de1b51a09..8179fa5a2a91 100644 --- a/samples/client/petstore/bash/README.md +++ b/samples/client/petstore/bash/README.md @@ -101,7 +101,8 @@ All URIs are relative to */v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AnotherFakeApi* | [**call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**createXmlItem**](docs/FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -110,9 +111,9 @@ Class | Method | HTTP request | Description *FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 +假端點 +偽のエンドポイント +가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -144,23 +145,13 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [$special[modelName]](docs/$special[modelName].md) - [200Response](docs/200Response.md) - - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Animal](docs/Animal.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - - [BigCat](docs/BigCat.md) - - [BigCatAllOf](docs/BigCatAllOf.md) - [Capitalization](docs/Capitalization.md) - [Cat](docs/Cat.md) - [CatAllOf](docs/CatAllOf.md) @@ -173,23 +164,34 @@ Class | Method | HTTP request | Description - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [InlineObject2](docs/InlineObject2.md) + - [InlineObject3](docs/InlineObject3.md) + - [InlineObject4](docs/InlineObject4.md) + - [InlineObject5](docs/InlineObject5.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Return](docs/Return.md) + - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - [User](docs/User.md) - - [XmlItem](docs/XmlItem.md) ## Documentation For Authorization @@ -209,6 +211,10 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key_query - **Location**: URL query string +## bearer_test + +- **Type**: HTTP basic authentication + ## http_basic_test - **Type**: HTTP basic authentication diff --git a/samples/client/petstore/bash/_petstore-cli b/samples/client/petstore/bash/_petstore-cli index 3a0073f2840c..323b934de071 100644 --- a/samples/client/petstore/bash/_petstore-cli +++ b/samples/client/petstore/bash/_petstore-cli @@ -296,7 +296,7 @@ case $state in ops) # Operations _values "Operations" \ - "call123TestSpecialTags[To test special tags]" "createXmlItem[creates an XmlItem]" \ + "call123TestSpecialTags[To test special tags]" "fooGet[]" "fakeHealthGet[Health check endpoint]" \ "fakeOuterBooleanSerialize[]" \ "fakeOuterCompositeSerialize[]" \ "fakeOuterNumberSerialize[]" \ @@ -305,9 +305,9 @@ case $state in "testBodyWithQueryParams[]" \ "testClientModel[To test \"client\" model]" \ "testEndpointParameters[Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트]" \ +假端點 +偽のエンドポイント +가짜 엔드 포인트]" \ "testEnumParameters[To test enum parameters]" \ "testGroupParameters[Fake endpoint to test group parameters (optional)]" \ "testInlineAdditionalProperties[test inline additionalProperties]" \ @@ -343,7 +343,13 @@ case $state in ) _describe -t actions 'operations' _op_arguments -S '' && ret=0 ;; - createXmlItem) + fooGet) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + fakeHealthGet) local -a _op_arguments _op_arguments=( ) diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md b/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md index 5b1ed2dce633..0b452819e9e1 100644 --- a/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md @@ -3,17 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mapUnderscorestring** | **map[String, string]** | | [optional] [default to null] -**mapUnderscorenumber** | **map[String, integer]** | | [optional] [default to null] -**mapUnderscoreinteger** | **map[String, integer]** | | [optional] [default to null] -**mapUnderscoreboolean** | **map[String, boolean]** | | [optional] [default to null] -**mapUnderscorearrayUnderscoreinteger** | **map[String, array[integer]]** | | [optional] [default to null] -**mapUnderscorearrayUnderscoreanytype** | **map[String, array[map]]** | | [optional] [default to null] -**mapUnderscoremapUnderscorestring** | **map[String, map[String, string]]** | | [optional] [default to null] -**mapUnderscoremapUnderscoreanytype** | **map[String, map[String, map]]** | | [optional] [default to null] -**anytypeUnderscore1** | [**map**](.md) | | [optional] [default to null] -**anytypeUnderscore2** | [**map**](.md) | | [optional] [default to null] -**anytypeUnderscore3** | [**map**](.md) | | [optional] [default to null] +**mapUnderscoreproperty** | **map[String, string]** | | [optional] [default to null] +**mapUnderscoreofUnderscoremapUnderscoreproperty** | **map[String, map[String, string]]** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/AnotherFakeApi.md b/samples/client/petstore/bash/docs/AnotherFakeApi.md index e17a9e75d006..8eda10a25080 100644 --- a/samples/client/petstore/bash/docs/AnotherFakeApi.md +++ b/samples/client/petstore/bash/docs/AnotherFakeApi.md @@ -25,7 +25,7 @@ petstore-cli call123TestSpecialTags Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | + **client** | [**Client**](Client.md) | client model | ### Return type diff --git a/samples/client/petstore/bash/docs/EnumTest.md b/samples/client/petstore/bash/docs/EnumTest.md index 30b30efa7307..3f70a0a0667a 100644 --- a/samples/client/petstore/bash/docs/EnumTest.md +++ b/samples/client/petstore/bash/docs/EnumTest.md @@ -8,6 +8,9 @@ Name | Type | Description | Notes **enumUnderscoreinteger** | **integer** | | [optional] [default to null] **enumUnderscorenumber** | **float** | | [optional] [default to null] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] [default to null] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] [default to null] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to null] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/FakeApi.md b/samples/client/petstore/bash/docs/FakeApi.md index 075407dede6d..905f6e2cd088 100644 --- a/samples/client/petstore/bash/docs/FakeApi.md +++ b/samples/client/petstore/bash/docs/FakeApi.md @@ -4,7 +4,7 @@ All URIs are relative to */v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -13,9 +13,9 @@ Method | HTTP request | Description [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 +假端點 +偽のエンドポイント +가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -24,28 +24,23 @@ Method | HTTP request | Description -## createXmlItem +## fakeHealthGet -creates an XmlItem - -this route creates an XmlItem +Health check endpoint ### Example ```bash -petstore-cli createXmlItem +petstore-cli fakeHealthGet ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xmlItem** | [**XmlItem**](XmlItem.md) | XmlItem Body | +This endpoint does not need any parameter. ### Return type -(empty response body) +[**HealthCheckResult**](HealthCheckResult.md) ### Authorization @@ -53,8 +48,8 @@ No authorization required ### HTTP request headers -- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 -- **Accept**: Not Applicable +- **Content-Type**: Not Applicable +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -88,7 +83,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: */* [[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) @@ -111,7 +106,7 @@ petstore-cli fakeOuterCompositeSerialize Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] ### Return type @@ -123,7 +118,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: */* [[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) @@ -158,7 +153,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: */* [[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) @@ -193,7 +188,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: */* [[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) @@ -216,7 +211,7 @@ petstore-cli testBodyWithFileSchema Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | ### Return type @@ -250,7 +245,7 @@ petstore-cli testBodyWithQueryParams query=value Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **string** | | [default to null] - **body** | [**User**](User.md) | | + **user** | [**User**](User.md) | | ### Return type @@ -285,7 +280,7 @@ petstore-cli testClientModel Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | + **client** | [**Client**](Client.md) | client model | ### Return type @@ -306,14 +301,14 @@ No authorization required ## testEndpointParameters Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 +假端點 +偽のエンドポイント +가짜 엔드 포인트 Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 +假端點 +偽のエンドポイント +가짜 엔드 포인트 ### Example @@ -366,7 +361,7 @@ To test enum parameters ### Example ```bash -petstore-cli testEnumParameters enum_header_string_array:value enum_header_string:value Specify as: enum_query_string_array="value1,value2,..." enum_query_string=value enum_query_integer=value enum_query_double=value +petstore-cli testEnumParameters enum_header_string_array:value enum_header_string:value Specify as: enum_query_string_array=value1 enum_query_string_array=value2 enum_query_string_array=... enum_query_string=value enum_query_integer=value enum_query_double=value ``` ### Parameters @@ -429,7 +424,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[bearer_test](../README.md#bearer_test) ### HTTP request headers @@ -454,7 +449,7 @@ petstore-cli testInlineAdditionalProperties Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**map[String, string]**](string.md) | request body | + **requestBody** | [**map[String, string]**](string.md) | request body | ### Return type @@ -515,7 +510,7 @@ To test the collection format in query parameters ### Example ```bash -petstore-cli testQueryParameterCollectionFormat Specify as: pipe="value1,value2,..." Specify as: ioutil="value1,value2,..." Specify as: http="value1 value2 ..." Specify as: url="value1,value2,..." Specify as: context=value1 context=value2 context=... +petstore-cli testQueryParameterCollectionFormat Specify as: pipe=value1 pipe=value2 pipe=... Specify as: ioutil="value1,value2,..." Specify as: Specify as: url="value1,value2,..." Specify as: context=value1 context=value2 context=... ``` ### Parameters diff --git a/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md b/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md index 19b3d386d383..f670ef5f7b9a 100644 --- a/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md @@ -25,7 +25,7 @@ petstore-cli testClassname Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | + **client** | [**Client**](Client.md) | client model | ### Return type diff --git a/samples/client/petstore/bash/docs/FormatTest.md b/samples/client/petstore/bash/docs/FormatTest.md index 385631d820c8..8fe26118a9dd 100644 --- a/samples/client/petstore/bash/docs/FormatTest.md +++ b/samples/client/petstore/bash/docs/FormatTest.md @@ -16,7 +16,8 @@ Name | Type | Description | Notes **dateTime** | **string** | | [optional] [default to null] **uuid** | **string** | | [optional] [default to null] **password** | **string** | | [default to null] -**BigDecimal** | [**BigDecimal**](BigDecimal.md) | | [optional] [default to null] +**patternUnderscorewithUnderscoredigits** | **string** | | [optional] [default to null] +**patternUnderscorewithUnderscoredigitsUnderscoreandUnderscoredelimiter** | **string** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/PetApi.md b/samples/client/petstore/bash/docs/PetApi.md index 320863082061..ddc4f21bffcd 100644 --- a/samples/client/petstore/bash/docs/PetApi.md +++ b/samples/client/petstore/bash/docs/PetApi.md @@ -31,7 +31,7 @@ petstore-cli addPet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type @@ -203,7 +203,7 @@ petstore-cli updatePet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type diff --git a/samples/client/petstore/bash/docs/StoreApi.md b/samples/client/petstore/bash/docs/StoreApi.md index 56b2934562b5..58ee002b7b86 100644 --- a/samples/client/petstore/bash/docs/StoreApi.md +++ b/samples/client/petstore/bash/docs/StoreApi.md @@ -128,7 +128,7 @@ petstore-cli placeOrder Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md) | order placed for purchasing the pet | + **order** | [**Order**](Order.md) | order placed for purchasing the pet | ### Return type @@ -140,7 +140,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/UserApi.md b/samples/client/petstore/bash/docs/UserApi.md index 9663a425b732..f36e39d38ee6 100644 --- a/samples/client/petstore/bash/docs/UserApi.md +++ b/samples/client/petstore/bash/docs/UserApi.md @@ -32,7 +32,7 @@ petstore-cli createUser Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md) | Created user object | + **user** | [**User**](User.md) | Created user object | ### Return type @@ -44,7 +44,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: Not Applicable [[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) @@ -65,7 +65,7 @@ petstore-cli createUsersWithArrayInput Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**array[User]**](User.md) | List of user object | + **user** | [**array[User]**](User.md) | List of user object | ### Return type @@ -77,7 +77,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: Not Applicable [[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) @@ -98,7 +98,7 @@ petstore-cli createUsersWithListInput Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**array[User]**](User.md) | List of user object | + **user** | [**array[User]**](User.md) | List of user object | ### Return type @@ -110,7 +110,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: Not Applicable [[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) @@ -266,7 +266,7 @@ petstore-cli updateUser username=value Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string** | name that need to be deleted | [default to null] - **body** | [**User**](User.md) | Updated user object | + **user** | [**User**](User.md) | Updated user object | ### Return type @@ -278,7 +278,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not Applicable +- **Content-Type**: application/json - **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index 3ea2de2a6a6c..7e496f60eeca 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -95,16 +95,15 @@ declare -a result_color_table=( "$WHITE" "$WHITE" "$GREEN" "$YELLOW" "$WHITE" "$ # 0 - optional # 1 - required declare -A operation_parameters_minimum_occurrences -operation_parameters_minimum_occurrences["call123TestSpecialTags:::body"]=1 -operation_parameters_minimum_occurrences["createXmlItem:::XmlItem"]=1 +operation_parameters_minimum_occurrences["call123TestSpecialTags:::Client"]=1 operation_parameters_minimum_occurrences["fakeOuterBooleanSerialize:::body"]=0 -operation_parameters_minimum_occurrences["fakeOuterCompositeSerialize:::body"]=0 +operation_parameters_minimum_occurrences["fakeOuterCompositeSerialize:::OuterComposite"]=0 operation_parameters_minimum_occurrences["fakeOuterNumberSerialize:::body"]=0 operation_parameters_minimum_occurrences["fakeOuterStringSerialize:::body"]=0 -operation_parameters_minimum_occurrences["testBodyWithFileSchema:::body"]=1 +operation_parameters_minimum_occurrences["testBodyWithFileSchema:::FileSchemaTestClass"]=1 operation_parameters_minimum_occurrences["testBodyWithQueryParams:::query"]=1 -operation_parameters_minimum_occurrences["testBodyWithQueryParams:::body"]=1 -operation_parameters_minimum_occurrences["testClientModel:::body"]=1 +operation_parameters_minimum_occurrences["testBodyWithQueryParams:::User"]=1 +operation_parameters_minimum_occurrences["testClientModel:::Client"]=1 operation_parameters_minimum_occurrences["testEndpointParameters:::number"]=1 operation_parameters_minimum_occurrences["testEndpointParameters:::double"]=1 operation_parameters_minimum_occurrences["testEndpointParameters:::pattern_without_delimiter"]=1 @@ -133,7 +132,7 @@ operation_parameters_minimum_occurrences["testGroupParameters:::required_int64_g operation_parameters_minimum_occurrences["testGroupParameters:::string_group"]=0 operation_parameters_minimum_occurrences["testGroupParameters:::boolean_group"]=0 operation_parameters_minimum_occurrences["testGroupParameters:::int64_group"]=0 -operation_parameters_minimum_occurrences["testInlineAdditionalProperties:::param"]=1 +operation_parameters_minimum_occurrences["testInlineAdditionalProperties:::request_body"]=1 operation_parameters_minimum_occurrences["testJsonFormData:::param"]=1 operation_parameters_minimum_occurrences["testJsonFormData:::param2"]=1 operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::pipe"]=1 @@ -141,14 +140,14 @@ operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::i operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::http"]=1 operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::url"]=1 operation_parameters_minimum_occurrences["testQueryParameterCollectionFormat:::context"]=1 -operation_parameters_minimum_occurrences["testClassname:::body"]=1 -operation_parameters_minimum_occurrences["addPet:::body"]=1 +operation_parameters_minimum_occurrences["testClassname:::Client"]=1 +operation_parameters_minimum_occurrences["addPet:::Pet"]=1 operation_parameters_minimum_occurrences["deletePet:::petId"]=1 operation_parameters_minimum_occurrences["deletePet:::api_key"]=0 operation_parameters_minimum_occurrences["findPetsByStatus:::status"]=1 operation_parameters_minimum_occurrences["findPetsByTags:::tags"]=1 operation_parameters_minimum_occurrences["getPetById:::petId"]=1 -operation_parameters_minimum_occurrences["updatePet:::body"]=1 +operation_parameters_minimum_occurrences["updatePet:::Pet"]=1 operation_parameters_minimum_occurrences["updatePetWithForm:::petId"]=1 operation_parameters_minimum_occurrences["updatePetWithForm:::name"]=0 operation_parameters_minimum_occurrences["updatePetWithForm:::status"]=0 @@ -160,16 +159,16 @@ operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::requiredF operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::additionalMetadata"]=0 operation_parameters_minimum_occurrences["deleteOrder:::order_id"]=1 operation_parameters_minimum_occurrences["getOrderById:::order_id"]=1 -operation_parameters_minimum_occurrences["placeOrder:::body"]=1 -operation_parameters_minimum_occurrences["createUser:::body"]=1 -operation_parameters_minimum_occurrences["createUsersWithArrayInput:::body"]=1 -operation_parameters_minimum_occurrences["createUsersWithListInput:::body"]=1 +operation_parameters_minimum_occurrences["placeOrder:::Order"]=1 +operation_parameters_minimum_occurrences["createUser:::User"]=1 +operation_parameters_minimum_occurrences["createUsersWithArrayInput:::User"]=1 +operation_parameters_minimum_occurrences["createUsersWithListInput:::User"]=1 operation_parameters_minimum_occurrences["deleteUser:::username"]=1 operation_parameters_minimum_occurrences["getUserByName:::username"]=1 operation_parameters_minimum_occurrences["loginUser:::username"]=1 operation_parameters_minimum_occurrences["loginUser:::password"]=1 operation_parameters_minimum_occurrences["updateUser:::username"]=1 -operation_parameters_minimum_occurrences["updateUser:::body"]=1 +operation_parameters_minimum_occurrences["updateUser:::User"]=1 ## # This array stores the maximum number of allowed occurrences for parameter @@ -178,16 +177,15 @@ operation_parameters_minimum_occurrences["updateUser:::body"]=1 # N - N values # 0 - unlimited declare -A operation_parameters_maximum_occurrences -operation_parameters_maximum_occurrences["call123TestSpecialTags:::body"]=0 -operation_parameters_maximum_occurrences["createXmlItem:::XmlItem"]=0 +operation_parameters_maximum_occurrences["call123TestSpecialTags:::Client"]=0 operation_parameters_maximum_occurrences["fakeOuterBooleanSerialize:::body"]=0 -operation_parameters_maximum_occurrences["fakeOuterCompositeSerialize:::body"]=0 +operation_parameters_maximum_occurrences["fakeOuterCompositeSerialize:::OuterComposite"]=0 operation_parameters_maximum_occurrences["fakeOuterNumberSerialize:::body"]=0 operation_parameters_maximum_occurrences["fakeOuterStringSerialize:::body"]=0 -operation_parameters_maximum_occurrences["testBodyWithFileSchema:::body"]=0 +operation_parameters_maximum_occurrences["testBodyWithFileSchema:::FileSchemaTestClass"]=0 operation_parameters_maximum_occurrences["testBodyWithQueryParams:::query"]=0 -operation_parameters_maximum_occurrences["testBodyWithQueryParams:::body"]=0 -operation_parameters_maximum_occurrences["testClientModel:::body"]=0 +operation_parameters_maximum_occurrences["testBodyWithQueryParams:::User"]=0 +operation_parameters_maximum_occurrences["testClientModel:::Client"]=0 operation_parameters_maximum_occurrences["testEndpointParameters:::number"]=0 operation_parameters_maximum_occurrences["testEndpointParameters:::double"]=0 operation_parameters_maximum_occurrences["testEndpointParameters:::pattern_without_delimiter"]=0 @@ -216,7 +214,7 @@ operation_parameters_maximum_occurrences["testGroupParameters:::required_int64_g operation_parameters_maximum_occurrences["testGroupParameters:::string_group"]=0 operation_parameters_maximum_occurrences["testGroupParameters:::boolean_group"]=0 operation_parameters_maximum_occurrences["testGroupParameters:::int64_group"]=0 -operation_parameters_maximum_occurrences["testInlineAdditionalProperties:::param"]=0 +operation_parameters_maximum_occurrences["testInlineAdditionalProperties:::request_body"]=0 operation_parameters_maximum_occurrences["testJsonFormData:::param"]=0 operation_parameters_maximum_occurrences["testJsonFormData:::param2"]=0 operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::pipe"]=0 @@ -224,14 +222,14 @@ operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::i operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::http"]=0 operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::url"]=0 operation_parameters_maximum_occurrences["testQueryParameterCollectionFormat:::context"]=0 -operation_parameters_maximum_occurrences["testClassname:::body"]=0 -operation_parameters_maximum_occurrences["addPet:::body"]=0 +operation_parameters_maximum_occurrences["testClassname:::Client"]=0 +operation_parameters_maximum_occurrences["addPet:::Pet"]=0 operation_parameters_maximum_occurrences["deletePet:::petId"]=0 operation_parameters_maximum_occurrences["deletePet:::api_key"]=0 operation_parameters_maximum_occurrences["findPetsByStatus:::status"]=0 operation_parameters_maximum_occurrences["findPetsByTags:::tags"]=0 operation_parameters_maximum_occurrences["getPetById:::petId"]=0 -operation_parameters_maximum_occurrences["updatePet:::body"]=0 +operation_parameters_maximum_occurrences["updatePet:::Pet"]=0 operation_parameters_maximum_occurrences["updatePetWithForm:::petId"]=0 operation_parameters_maximum_occurrences["updatePetWithForm:::name"]=0 operation_parameters_maximum_occurrences["updatePetWithForm:::status"]=0 @@ -243,31 +241,30 @@ operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::requiredF operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::additionalMetadata"]=0 operation_parameters_maximum_occurrences["deleteOrder:::order_id"]=0 operation_parameters_maximum_occurrences["getOrderById:::order_id"]=0 -operation_parameters_maximum_occurrences["placeOrder:::body"]=0 -operation_parameters_maximum_occurrences["createUser:::body"]=0 -operation_parameters_maximum_occurrences["createUsersWithArrayInput:::body"]=0 -operation_parameters_maximum_occurrences["createUsersWithListInput:::body"]=0 +operation_parameters_maximum_occurrences["placeOrder:::Order"]=0 +operation_parameters_maximum_occurrences["createUser:::User"]=0 +operation_parameters_maximum_occurrences["createUsersWithArrayInput:::User"]=0 +operation_parameters_maximum_occurrences["createUsersWithListInput:::User"]=0 operation_parameters_maximum_occurrences["deleteUser:::username"]=0 operation_parameters_maximum_occurrences["getUserByName:::username"]=0 operation_parameters_maximum_occurrences["loginUser:::username"]=0 operation_parameters_maximum_occurrences["loginUser:::password"]=0 operation_parameters_maximum_occurrences["updateUser:::username"]=0 -operation_parameters_maximum_occurrences["updateUser:::body"]=0 +operation_parameters_maximum_occurrences["updateUser:::User"]=0 ## # The type of collection for specifying multiple values for parameter: # - multi, csv, ssv, tsv declare -A operation_parameters_collection_type -operation_parameters_collection_type["call123TestSpecialTags:::body"]="" -operation_parameters_collection_type["createXmlItem:::XmlItem"]="" +operation_parameters_collection_type["call123TestSpecialTags:::Client"]="" operation_parameters_collection_type["fakeOuterBooleanSerialize:::body"]="" -operation_parameters_collection_type["fakeOuterCompositeSerialize:::body"]="" +operation_parameters_collection_type["fakeOuterCompositeSerialize:::OuterComposite"]="" operation_parameters_collection_type["fakeOuterNumberSerialize:::body"]="" operation_parameters_collection_type["fakeOuterStringSerialize:::body"]="" -operation_parameters_collection_type["testBodyWithFileSchema:::body"]="" +operation_parameters_collection_type["testBodyWithFileSchema:::FileSchemaTestClass"]="" operation_parameters_collection_type["testBodyWithQueryParams:::query"]="" -operation_parameters_collection_type["testBodyWithQueryParams:::body"]="" -operation_parameters_collection_type["testClientModel:::body"]="" +operation_parameters_collection_type["testBodyWithQueryParams:::User"]="" +operation_parameters_collection_type["testClientModel:::Client"]="" operation_parameters_collection_type["testEndpointParameters:::number"]="" operation_parameters_collection_type["testEndpointParameters:::double"]="" operation_parameters_collection_type["testEndpointParameters:::pattern_without_delimiter"]="" @@ -284,7 +281,7 @@ operation_parameters_collection_type["testEndpointParameters:::password"]="" operation_parameters_collection_type["testEndpointParameters:::callback"]="" operation_parameters_collection_type["testEnumParameters:::enum_header_string_array"]="csv" operation_parameters_collection_type["testEnumParameters:::enum_header_string"]="" -operation_parameters_collection_type["testEnumParameters:::enum_query_string_array"]="csv" +operation_parameters_collection_type["testEnumParameters:::enum_query_string_array"]="multi" operation_parameters_collection_type["testEnumParameters:::enum_query_string"]="" operation_parameters_collection_type["testEnumParameters:::enum_query_integer"]="" operation_parameters_collection_type["testEnumParameters:::enum_query_double"]="" @@ -296,22 +293,22 @@ operation_parameters_collection_type["testGroupParameters:::required_int64_group operation_parameters_collection_type["testGroupParameters:::string_group"]="" operation_parameters_collection_type["testGroupParameters:::boolean_group"]="" operation_parameters_collection_type["testGroupParameters:::int64_group"]="" -operation_parameters_collection_type["testInlineAdditionalProperties:::param"]= +operation_parameters_collection_type["testInlineAdditionalProperties:::request_body"]= operation_parameters_collection_type["testJsonFormData:::param"]="" operation_parameters_collection_type["testJsonFormData:::param2"]="" -operation_parameters_collection_type["testQueryParameterCollectionFormat:::pipe"]="csv" +operation_parameters_collection_type["testQueryParameterCollectionFormat:::pipe"]="multi" operation_parameters_collection_type["testQueryParameterCollectionFormat:::ioutil"]="csv" -operation_parameters_collection_type["testQueryParameterCollectionFormat:::http"]="ssv" +operation_parameters_collection_type["testQueryParameterCollectionFormat:::http"]= operation_parameters_collection_type["testQueryParameterCollectionFormat:::url"]="csv" operation_parameters_collection_type["testQueryParameterCollectionFormat:::context"]="multi" -operation_parameters_collection_type["testClassname:::body"]="" -operation_parameters_collection_type["addPet:::body"]="" +operation_parameters_collection_type["testClassname:::Client"]="" +operation_parameters_collection_type["addPet:::Pet"]="" operation_parameters_collection_type["deletePet:::petId"]="" operation_parameters_collection_type["deletePet:::api_key"]="" operation_parameters_collection_type["findPetsByStatus:::status"]="csv" operation_parameters_collection_type["findPetsByTags:::tags"]="csv" operation_parameters_collection_type["getPetById:::petId"]="" -operation_parameters_collection_type["updatePet:::body"]="" +operation_parameters_collection_type["updatePet:::Pet"]="" operation_parameters_collection_type["updatePetWithForm:::petId"]="" operation_parameters_collection_type["updatePetWithForm:::name"]="" operation_parameters_collection_type["updatePetWithForm:::status"]="" @@ -323,16 +320,16 @@ operation_parameters_collection_type["uploadFileWithRequiredFile:::requiredFile" operation_parameters_collection_type["uploadFileWithRequiredFile:::additionalMetadata"]="" operation_parameters_collection_type["deleteOrder:::order_id"]="" operation_parameters_collection_type["getOrderById:::order_id"]="" -operation_parameters_collection_type["placeOrder:::body"]="" -operation_parameters_collection_type["createUser:::body"]="" -operation_parameters_collection_type["createUsersWithArrayInput:::body"]= -operation_parameters_collection_type["createUsersWithListInput:::body"]= +operation_parameters_collection_type["placeOrder:::Order"]="" +operation_parameters_collection_type["createUser:::User"]="" +operation_parameters_collection_type["createUsersWithArrayInput:::User"]= +operation_parameters_collection_type["createUsersWithListInput:::User"]= operation_parameters_collection_type["deleteUser:::username"]="" operation_parameters_collection_type["getUserByName:::username"]="" operation_parameters_collection_type["loginUser:::username"]="" operation_parameters_collection_type["loginUser:::password"]="" operation_parameters_collection_type["updateUser:::username"]="" -operation_parameters_collection_type["updateUser:::body"]="" +operation_parameters_collection_type["updateUser:::User"]="" ## @@ -725,6 +722,8 @@ EOF echo -e " or export ${RED}PETSTORE_API_KEY=''${OFF}" echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u :' before ${YELLOW}${OFF}" echo -e " or export ${RED}PETSTORE_BASIC_AUTH=':'${OFF}" + echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u :' before ${YELLOW}${OFF}" + echo -e " or export ${RED}PETSTORE_BASIC_AUTH=':'${OFF}" echo -e " - ${MAGENTA}OAuth2 (flow: implicit)${OFF}" echo -e " Authorization URL: " echo -e " * http://petstore.swagger.io/api/oauth/dialog" @@ -738,11 +737,17 @@ EOF read -r -d '' ops <&1 | grep -v 'To https' diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj index 22154d797a8d..4dc96302b70a 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj @@ -15,13 +15,13 @@ (defn-spec add-pet-with-http-info any? "Add a new pet to the store" ([] (add-pet-with-http-info nil)) - ([{:keys [body]} (s/map-of keyword? any?)] + ([{:keys [pet]} (s/map-of keyword? any?)] (call-api "/pet" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param body + :body-param pet :content-types ["application/json" "application/xml"] :accepts [] :auth-names ["petstore_auth"]}))) @@ -137,13 +137,13 @@ (defn-spec update-pet-with-http-info any? "Update an existing pet" ([] (update-pet-with-http-info nil)) - ([{:keys [body]} (s/map-of keyword? any?)] + ([{:keys [pet]} (s/map-of keyword? any?)] (call-api "/pet" :put {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param body + :body-param pet :content-types ["application/json" "application/xml"] :accepts [] :auth-names ["petstore_auth"]}))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj index aa35487c2f55..a91c086c3fd4 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj @@ -86,13 +86,13 @@ (defn-spec place-order-with-http-info any? "Place an order for a pet" ([] (place-order-with-http-info nil)) - ([{:keys [body]} (s/map-of keyword? any?)] + ([{:keys [order]} (s/map-of keyword? any?)] (call-api "/store/order" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param body + :body-param order :content-types [] :accepts ["application/json" "application/xml"] :auth-names []}))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj index 301195b823ad..ee758efedcd6 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj @@ -16,13 +16,13 @@ "Create user This can only be done by the logged in user." ([] (create-user-with-http-info nil)) - ([{:keys [body]} (s/map-of keyword? any?)] + ([{:keys [user]} (s/map-of keyword? any?)] (call-api "/user" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param body + :body-param user :content-types [] :accepts [] :auth-names []}))) @@ -41,13 +41,13 @@ (defn-spec create-users-with-array-input-with-http-info any? "Creates list of users with given input array" ([] (create-users-with-array-input-with-http-info nil)) - ([{:keys [body]} (s/map-of keyword? any?)] + ([{:keys [user]} (s/map-of keyword? any?)] (call-api "/user/createWithArray" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param body + :body-param user :content-types [] :accepts [] :auth-names []}))) @@ -65,13 +65,13 @@ (defn-spec create-users-with-list-input-with-http-info any? "Creates list of users with given input array" ([] (create-users-with-list-input-with-http-info nil)) - ([{:keys [body]} (s/map-of keyword? any?)] + ([{:keys [user]} (s/map-of keyword? any?)] (call-api "/user/createWithList" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param body + :body-param user :content-types [] :accepts [] :auth-names []}))) @@ -180,14 +180,14 @@ "Updated user This can only be done by the logged in user." ([username string?, ] (update-user-with-http-info username nil)) - ([username string?, {:keys [body]} (s/map-of keyword? any?)] + ([username string?, {:keys [user]} (s/map-of keyword? any?)] (check-required-params username) (call-api "/user/{username}" :put {:path-params {"username" username } :header-params {} :query-params {} :form-params {} - :body-param body + :body-param user :content-types [] :accepts [] :auth-names []}))) diff --git a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION index bfbf77eb7fad..4395ff592326 100644 --- a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.cpp b/samples/client/petstore/cpp-tizen/src/PetManager.cpp index 2f273a21e10d..0c6a57eee3fe 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/PetManager.cpp @@ -82,7 +82,7 @@ static bool addPetProcessor(MemoryStruct_s p_chunk, long code, char* errormsg, v } static bool addPetHelper(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -105,10 +105,10 @@ static bool addPetHelper(char * accessToken, JsonArray* json_array; if (isprimitive("Pet")) { - node = converttoJson(&body, "Pet", ""); + node = converttoJson(&pet, "Pet", ""); } - char *jsonStr = body.toJson(); + char *jsonStr = pet.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -167,22 +167,22 @@ static bool addPetHelper(char * accessToken, bool PetManager::addPetAsync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData) { return addPetHelper(accessToken, - body, + pet, handler, userData, true); } bool PetManager::addPetSync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData) { return addPetHelper(accessToken, - body, + pet, handler, userData, false); } @@ -796,7 +796,7 @@ static bool updatePetProcessor(MemoryStruct_s p_chunk, long code, char* errormsg } static bool updatePetHelper(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -819,10 +819,10 @@ static bool updatePetHelper(char * accessToken, JsonArray* json_array; if (isprimitive("Pet")) { - node = converttoJson(&body, "Pet", ""); + node = converttoJson(&pet, "Pet", ""); } - char *jsonStr = body.toJson(); + char *jsonStr = pet.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -881,22 +881,22 @@ static bool updatePetHelper(char * accessToken, bool PetManager::updatePetAsync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData) { return updatePetHelper(accessToken, - body, + pet, handler, userData, true); } bool PetManager::updatePetSync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData) { return updatePetHelper(accessToken, - body, + pet, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.h b/samples/client/petstore/cpp-tizen/src/PetManager.h index 93f095441200..e3ab9a775b17 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.h +++ b/samples/client/petstore/cpp-tizen/src/PetManager.h @@ -28,26 +28,26 @@ class PetManager { /*! \brief Add a new pet to the store. *Synchronous* * * - * \param body Pet object that needs to be added to the store *Required* + * \param pet Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool addPetSync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData); /*! \brief Add a new pet to the store. *Asynchronous* * * - * \param body Pet object that needs to be added to the store *Required* + * \param pet Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool addPetAsync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData); @@ -165,26 +165,26 @@ bool getPetByIdAsync(char * accessToken, /*! \brief Update an existing pet. *Synchronous* * * - * \param body Pet object that needs to be added to the store *Required* + * \param pet Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updatePetSync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData); /*! \brief Update an existing pet. *Asynchronous* * * - * \param body Pet object that needs to be added to the store *Required* + * \param pet Pet object that needs to be added to the store *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updatePetAsync(char * accessToken, - Pet body, + Pet pet, void(* handler)(Error, void* ) , void* userData); diff --git a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp index e107ff844349..91958248d70f 100644 --- a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp @@ -510,7 +510,7 @@ static bool placeOrderProcessor(MemoryStruct_s p_chunk, long code, char* errorms } static bool placeOrderHelper(char * accessToken, - Order body, + Order order, void(* handler)(Order, Error, void* ) , void* userData, bool isAsync) { @@ -532,10 +532,10 @@ static bool placeOrderHelper(char * accessToken, JsonArray* json_array; if (isprimitive("Order")) { - node = converttoJson(&body, "Order", ""); + node = converttoJson(&order, "Order", ""); } - char *jsonStr = body.toJson(); + char *jsonStr = order.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -594,22 +594,22 @@ static bool placeOrderHelper(char * accessToken, bool StoreManager::placeOrderAsync(char * accessToken, - Order body, + Order order, void(* handler)(Order, Error, void* ) , void* userData) { return placeOrderHelper(accessToken, - body, + order, handler, userData, true); } bool StoreManager::placeOrderSync(char * accessToken, - Order body, + Order order, void(* handler)(Order, Error, void* ) , void* userData) { return placeOrderHelper(accessToken, - body, + order, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/StoreManager.h b/samples/client/petstore/cpp-tizen/src/StoreManager.h index 9736475b3810..ac172733f735 100644 --- a/samples/client/petstore/cpp-tizen/src/StoreManager.h +++ b/samples/client/petstore/cpp-tizen/src/StoreManager.h @@ -107,26 +107,26 @@ bool getOrderByIdAsync(char * accessToken, /*! \brief Place an order for a pet. *Synchronous* * * - * \param body order placed for purchasing the pet *Required* + * \param order order placed for purchasing the pet *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool placeOrderSync(char * accessToken, - Order body, + Order order, void(* handler)(Order, Error, void* ) , void* userData); /*! \brief Place an order for a pet. *Asynchronous* * * - * \param body order placed for purchasing the pet *Required* + * \param order order placed for purchasing the pet *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool placeOrderAsync(char * accessToken, - Order body, + Order order, void(* handler)(Order, Error, void* ) , void* userData); diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.cpp b/samples/client/petstore/cpp-tizen/src/UserManager.cpp index ab3a7e40964f..bd51f9bc0516 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/UserManager.cpp @@ -82,7 +82,7 @@ static bool createUserProcessor(MemoryStruct_s p_chunk, long code, char* errorms } static bool createUserHelper(char * accessToken, - User body, + User user, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -104,10 +104,10 @@ static bool createUserHelper(char * accessToken, JsonArray* json_array; if (isprimitive("User")) { - node = converttoJson(&body, "User", ""); + node = converttoJson(&user, "User", ""); } - char *jsonStr = body.toJson(); + char *jsonStr = user.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -166,22 +166,22 @@ static bool createUserHelper(char * accessToken, bool UserManager::createUserAsync(char * accessToken, - User body, + User user, void(* handler)(Error, void* ) , void* userData) { return createUserHelper(accessToken, - body, + user, handler, userData, true); } bool UserManager::createUserSync(char * accessToken, - User body, + User user, void(* handler)(Error, void* ) , void* userData) { return createUserHelper(accessToken, - body, + user, handler, userData, false); } @@ -219,7 +219,7 @@ static bool createUsersWithArrayInputProcessor(MemoryStruct_s p_chunk, long code } static bool createUsersWithArrayInputHelper(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -240,14 +240,14 @@ static bool createUsersWithArrayInputHelper(char * accessToken, JsonNode* node; JsonArray* json_array; //TODO: Map Container - if (isprimitive("User")) { - node = converttoJson(&body, "User", "array"); + if (isprimitive("std::list")) { + node = converttoJson(&user, "std::list", "array"); } else { node = json_node_alloc(); json_array = json_array_new(); for (std::list - ::iterator bodyIter = body.begin(); bodyIter != body.end(); ++bodyIter) { - User itemAt = (*bodyIter); + ::iterator bodyIter = user.begin(); bodyIter != user.end(); ++bodyIter) { + std::list itemAt = (*bodyIter); char *jsonStr = itemAt.toJson(); JsonNode *node_temp = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -315,22 +315,22 @@ static bool createUsersWithArrayInputHelper(char * accessToken, bool UserManager::createUsersWithArrayInputAsync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData) { return createUsersWithArrayInputHelper(accessToken, - body, + user, handler, userData, true); } bool UserManager::createUsersWithArrayInputSync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData) { return createUsersWithArrayInputHelper(accessToken, - body, + user, handler, userData, false); } @@ -368,7 +368,7 @@ static bool createUsersWithListInputProcessor(MemoryStruct_s p_chunk, long code, } static bool createUsersWithListInputHelper(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -389,14 +389,14 @@ static bool createUsersWithListInputHelper(char * accessToken, JsonNode* node; JsonArray* json_array; //TODO: Map Container - if (isprimitive("User")) { - node = converttoJson(&body, "User", "array"); + if (isprimitive("std::list")) { + node = converttoJson(&user, "std::list", "array"); } else { node = json_node_alloc(); json_array = json_array_new(); for (std::list - ::iterator bodyIter = body.begin(); bodyIter != body.end(); ++bodyIter) { - User itemAt = (*bodyIter); + ::iterator bodyIter = user.begin(); bodyIter != user.end(); ++bodyIter) { + std::list itemAt = (*bodyIter); char *jsonStr = itemAt.toJson(); JsonNode *node_temp = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -464,22 +464,22 @@ static bool createUsersWithListInputHelper(char * accessToken, bool UserManager::createUsersWithListInputAsync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData) { return createUsersWithListInputHelper(accessToken, - body, + user, handler, userData, true); } bool UserManager::createUsersWithListInputSync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData) { return createUsersWithListInputHelper(accessToken, - body, + user, handler, userData, false); } @@ -1072,7 +1072,7 @@ static bool updateUserProcessor(MemoryStruct_s p_chunk, long code, char* errorms } static bool updateUserHelper(char * accessToken, - std::string username, User body, + std::string username, User user, void(* handler)(Error, void* ) , void* userData, bool isAsync) { @@ -1094,10 +1094,10 @@ static bool updateUserHelper(char * accessToken, JsonArray* json_array; if (isprimitive("User")) { - node = converttoJson(&body, "User", ""); + node = converttoJson(&user, "User", ""); } - char *jsonStr = body.toJson(); + char *jsonStr = user.toJson(); node = json_from_string(jsonStr, NULL); g_free(static_cast(jsonStr)); @@ -1162,22 +1162,22 @@ static bool updateUserHelper(char * accessToken, bool UserManager::updateUserAsync(char * accessToken, - std::string username, User body, + std::string username, User user, void(* handler)(Error, void* ) , void* userData) { return updateUserHelper(accessToken, - username, body, + username, user, handler, userData, true); } bool UserManager::updateUserSync(char * accessToken, - std::string username, User body, + std::string username, User user, void(* handler)(Error, void* ) , void* userData) { return updateUserHelper(accessToken, - username, body, + username, user, handler, userData, false); } diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.h b/samples/client/petstore/cpp-tizen/src/UserManager.h index 0b72c159294c..7429af29f3aa 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.h +++ b/samples/client/petstore/cpp-tizen/src/UserManager.h @@ -28,26 +28,26 @@ class UserManager { /*! \brief Create user. *Synchronous* * * This can only be done by the logged in user. - * \param body Created user object *Required* + * \param user Created user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUserSync(char * accessToken, - User body, + User user, void(* handler)(Error, void* ) , void* userData); /*! \brief Create user. *Asynchronous* * * This can only be done by the logged in user. - * \param body Created user object *Required* + * \param user Created user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUserAsync(char * accessToken, - User body, + User user, void(* handler)(Error, void* ) , void* userData); @@ -55,26 +55,26 @@ bool createUserAsync(char * accessToken, /*! \brief Creates list of users with given input array. *Synchronous* * * - * \param body List of user object *Required* + * \param user List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithArrayInputSync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData); /*! \brief Creates list of users with given input array. *Asynchronous* * * - * \param body List of user object *Required* + * \param user List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithArrayInputAsync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData); @@ -82,26 +82,26 @@ bool createUsersWithArrayInputAsync(char * accessToken, /*! \brief Creates list of users with given input array. *Synchronous* * * - * \param body List of user object *Required* + * \param user List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithListInputSync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData); /*! \brief Creates list of users with given input array. *Asynchronous* * * - * \param body List of user object *Required* + * \param user List of user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool createUsersWithListInputAsync(char * accessToken, - std::list body, + std::list user, void(* handler)(Error, void* ) , void* userData); @@ -218,13 +218,13 @@ bool logoutUserAsync(char * accessToken, * * This can only be done by the logged in user. * \param username name that need to be deleted *Required* - * \param body Updated user object *Required* + * \param user Updated user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updateUserSync(char * accessToken, - std::string username, User body, + std::string username, User user, void(* handler)(Error, void* ) , void* userData); @@ -232,13 +232,13 @@ bool updateUserSync(char * accessToken, * * This can only be done by the logged in user. * \param username name that need to be deleted *Required* - * \param body Updated user object *Required* + * \param user Updated user object *Required* * \param handler The callback function to be invoked on completion. *Required* * \param accessToken The Authorization token. *Required* * \param userData The user data to be passed to the callback function. */ bool updateUserAsync(char * accessToken, - std::string username, User body, + std::string username, User user, void(* handler)(Error, void* ) , void* userData); diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION index bfbf77eb7fad..c3a2c7076fa8 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file 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 02a246e64f9c..a4ab49f4424d 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 @@ -2697,7 +2697,7 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); } if (url != null) { @@ -2795,7 +2795,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); } if (url != 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 02a246e64f9c..a4ab49f4424d 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 @@ -2697,7 +2697,7 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); } if (url != null) { @@ -2795,7 +2795,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 91165c854fa5..8739ddfa49a1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -2949,7 +2949,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3038,7 +3038,7 @@ public async System.Threading.Tasks.Task> TestQueryParameter if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file 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 d5a4cc4d5c79..ec114cf37c7a 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 @@ -1567,7 +1567,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file 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 db577577708c..7da4d32ecbc6 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 @@ -1567,7 +1567,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION index bfbf77eb7fad..c3a2c7076fa8 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md index 19c69aa88d0b..a5bb974627f4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/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 @@ -135,8 +135,6 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) - - [Model.BigCat](docs/BigCat.md) - - [Model.BigCatAllOf](docs/BigCatAllOf.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) - [Model.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md index edffb58d3c79..a295fe0554f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/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/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs index 52f449f7e866..9eb33690b176 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs @@ -195,10 +195,10 @@ public interface IFakeApi : IApiAccessor /// 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 @@ public interface IFakeApi : IApiAccessor 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 @@ public interface IFakeApi : IApiAccessor /// 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 @@ public interface IFakeApi : IApiAccessor 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 @@ public async System.Threading.Tasks.Task> TestClientMod } /// - /// 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 @@ public async System.Threading.Tasks.Task> TestClientMod } /// - /// 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 @@ public async System.Threading.Tasks.Task> TestClientMod } /// - /// 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 @@ public async System.Threading.Tasks.Task> TestClientMod } /// - /// 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 @@ -2949,7 +2949,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3038,7 +3038,7 @@ public async System.Threading.Tasks.Task> TestQueryParameter if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs index 4b8e41dc2a13..3d9c30ab1fcb 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs @@ -259,8 +259,6 @@ public string ParameterToString(object obj) // 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/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs index 1f209ecbc1c4..7f63524790a4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs @@ -30,7 +30,6 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] - [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] public partial class Animal : IEquatable { /// diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file 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 52f449f7e866..6195602de816 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 @@ -2949,7 +2949,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3038,7 +3038,7 @@ public async System.Threading.Tasks.Task> TestQueryParameter if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file 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 91165c854fa5..8739ddfa49a1 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 @@ -2949,7 +2949,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3038,7 +3038,7 @@ public async System.Threading.Tasks.Task> TestQueryParameter if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/dart-dio/.openapi-generator/VERSION b/samples/client/petstore/dart-dio/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/client/petstore/dart-dio/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-dio/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/eiffel/.openapi-generator/VERSION b/samples/client/petstore/eiffel/.openapi-generator/VERSION index bfbf77eb7fad..096bf47efe31 100644 --- a/samples/client/petstore/eiffel/.openapi-generator/VERSION +++ b/samples/client/petstore/eiffel/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/eiffel/README.md b/samples/client/petstore/eiffel/README.md index 3a4dc717587c..bb363368532d 100644 --- a/samples/client/petstore/eiffel/README.md +++ b/samples/client/petstore/eiffel/README.md @@ -21,21 +21,17 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*ANOTHERFAKE_API* | [**123_test_special_tags**](docs/ANOTHERFAKE_API.md#123_test_special_tags) | **Patch** /another-fake/dummy | To test special tags -*FAKE_API* | [**create_xml_item**](docs/FAKE_API.md#create_xml_item) | **Post** /fake/create_xml_item | creates an XmlItem +*ANOTHERFAKE_API* | [**test_special_tags**](docs/ANOTHERFAKE_API.md#test_special_tags) | **Patch** /another-fake/dummy | To test special tags *FAKE_API* | [**fake_outer_boolean_serialize**](docs/FAKE_API.md#fake_outer_boolean_serialize) | **Post** /fake/outer/boolean | *FAKE_API* | [**fake_outer_composite_serialize**](docs/FAKE_API.md#fake_outer_composite_serialize) | **Post** /fake/outer/composite | *FAKE_API* | [**fake_outer_number_serialize**](docs/FAKE_API.md#fake_outer_number_serialize) | **Post** /fake/outer/number | *FAKE_API* | [**fake_outer_string_serialize**](docs/FAKE_API.md#fake_outer_string_serialize) | **Post** /fake/outer/string | -*FAKE_API* | [**test_body_with_file_schema**](docs/FAKE_API.md#test_body_with_file_schema) | **Put** /fake/body-with-file-schema | *FAKE_API* | [**test_body_with_query_params**](docs/FAKE_API.md#test_body_with_query_params) | **Put** /fake/body-with-query-params | *FAKE_API* | [**test_client_model**](docs/FAKE_API.md#test_client_model) | **Patch** /fake | To test \"client\" model -*FAKE_API* | [**test_endpoint_parameters**](docs/FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FAKE_API* | [**test_endpoint_parameters**](docs/FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FAKE_API* | [**test_enum_parameters**](docs/FAKE_API.md#test_enum_parameters) | **Get** /fake | To test enum parameters -*FAKE_API* | [**test_group_parameters**](docs/FAKE_API.md#test_group_parameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) *FAKE_API* | [**test_inline_additional_properties**](docs/FAKE_API.md#test_inline_additional_properties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties *FAKE_API* | [**test_json_form_data**](docs/FAKE_API.md#test_json_form_data) | **Get** /fake/jsonFormData | test json serialization of form data -*FAKE_API* | [**test_query_parameter_collection_format**](docs/FAKE_API.md#test_query_parameter_collection_format) | **Put** /fake/test-query-paramters | *FAKECLASSNAMETAGS123_API* | [**test_classname**](docs/FAKECLASSNAMETAGS123_API.md#test_classname) | **Patch** /fake_classname_test | To test class name in snake case *PET_API* | [**add_pet**](docs/PET_API.md#add_pet) | **Post** /pet | Add a new pet to the store *PET_API* | [**delete_pet**](docs/PET_API.md#delete_pet) | **Delete** /pet/{petId} | Deletes a pet @@ -45,7 +41,6 @@ Class | Method | HTTP request | Description *PET_API* | [**update_pet**](docs/PET_API.md#update_pet) | **Put** /pet | Update an existing pet *PET_API* | [**update_pet_with_form**](docs/PET_API.md#update_pet_with_form) | **Post** /pet/{petId} | Updates a pet in the store with form data *PET_API* | [**upload_file**](docs/PET_API.md#upload_file) | **Post** /pet/{petId}/uploadImage | uploads an image -*PET_API* | [**upload_file_with_required_file**](docs/PET_API.md#upload_file_with_required_file) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *STORE_API* | [**delete_order**](docs/STORE_API.md#delete_order) | **Delete** /store/order/{order_id} | Delete purchase order by ID *STORE_API* | [**inventory**](docs/STORE_API.md#inventory) | **Get** /store/inventory | Returns pet inventories by status *STORE_API* | [**order_by_id**](docs/STORE_API.md#order_by_id) | **Get** /store/order/{order_id} | Find purchase order by ID @@ -62,33 +57,22 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [ADDITIONAL_PROPERTIES_ANY_TYPE](docs/ADDITIONAL_PROPERTIES_ANY_TYPE.md) - - [ADDITIONAL_PROPERTIES_ARRAY](docs/ADDITIONAL_PROPERTIES_ARRAY.md) - - [ADDITIONAL_PROPERTIES_BOOLEAN](docs/ADDITIONAL_PROPERTIES_BOOLEAN.md) - [ADDITIONAL_PROPERTIES_CLASS](docs/ADDITIONAL_PROPERTIES_CLASS.md) - - [ADDITIONAL_PROPERTIES_INTEGER](docs/ADDITIONAL_PROPERTIES_INTEGER.md) - - [ADDITIONAL_PROPERTIES_NUMBER](docs/ADDITIONAL_PROPERTIES_NUMBER.md) - - [ADDITIONAL_PROPERTIES_OBJECT](docs/ADDITIONAL_PROPERTIES_OBJECT.md) - - [ADDITIONAL_PROPERTIES_STRING](docs/ADDITIONAL_PROPERTIES_STRING.md) - [ANIMAL](docs/ANIMAL.md) + - [ANIMAL_FARM](docs/ANIMAL_FARM.md) - [API_RESPONSE](docs/API_RESPONSE.md) - [ARRAY_OF_ARRAY_OF_NUMBER_ONLY](docs/ARRAY_OF_ARRAY_OF_NUMBER_ONLY.md) - [ARRAY_OF_NUMBER_ONLY](docs/ARRAY_OF_NUMBER_ONLY.md) - [ARRAY_TEST](docs/ARRAY_TEST.md) - - [BIG_CAT](docs/BIG_CAT.md) - - [BIG_CAT_ALL_OF](docs/BIG_CAT_ALL_OF.md) - [CAPITALIZATION](docs/CAPITALIZATION.md) - [CAT](docs/CAT.md) - [CATEGORY](docs/CATEGORY.md) - - [CAT_ALL_OF](docs/CAT_ALL_OF.md) - [CLASS_MODEL](docs/CLASS_MODEL.md) - [CLIENT](docs/CLIENT.md) - [DOG](docs/DOG.md) - - [DOG_ALL_OF](docs/DOG_ALL_OF.md) - [ENUM_ARRAYS](docs/ENUM_ARRAYS.md) - [ENUM_CLASS](docs/ENUM_CLASS.md) - [ENUM_TEST](docs/ENUM_TEST.md) - - [FILE_SCHEMA_TEST_CLASS](docs/FILE_SCHEMA_TEST_CLASS.md) - [FORMAT_TEST](docs/FORMAT_TEST.md) - [HAS_ONLY_READ_ONLY](docs/HAS_ONLY_READ_ONLY.md) - [MAP_TEST](docs/MAP_TEST.md) @@ -104,10 +88,7 @@ Class | Method | HTTP request | Description - [RETURN](docs/RETURN.md) - [SPECIAL_MODEL_NAME](docs/SPECIAL_MODEL_NAME.md) - [TAG](docs/TAG.md) - - [TYPE_HOLDER_DEFAULT](docs/TYPE_HOLDER_DEFAULT.md) - - [TYPE_HOLDER_EXAMPLE](docs/TYPE_HOLDER_EXAMPLE.md) - [USER](docs/USER.md) - - [XML_ITEM](docs/XML_ITEM.md) ## Documentation For Authorization diff --git a/samples/client/petstore/eiffel/api_client.ecf b/samples/client/petstore/eiffel/api_client.ecf index c1684f99520a..6f0ef48e4822 100644 --- a/samples/client/petstore/eiffel/api_client.ecf +++ b/samples/client/petstore/eiffel/api_client.ecf @@ -1,5 +1,5 @@ - + diff --git a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_CLASS.md b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_CLASS.md index df287ff108ab..6c76a177ee5b 100644 --- a/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_CLASS.md +++ b/samples/client/petstore/eiffel/docs/ADDITIONAL_PROPERTIES_CLASS.md @@ -3,17 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_string** | [**STRING_TABLE[STRING_32]**](STRING_32.md) | | [optional] [default to null] -**map_number** | **STRING_TABLE[REAL_32]** | | [optional] [default to null] -**map_integer** | **STRING_TABLE[INTEGER_32]** | | [optional] [default to null] -**map_boolean** | **STRING_TABLE[BOOLEAN]** | | [optional] [default to null] -**map_array_integer** | [**STRING_TABLE[LIST [INTEGER_32]]**](LIST.md) | | [optional] [default to null] -**map_array_anytype** | [**STRING_TABLE[LIST [ANY]]**](LIST.md) | | [optional] [default to null] -**map_map_string** | [**STRING_TABLE[STRING_TABLE[STRING_32]]**](STRING_TABLE.md) | | [optional] [default to null] -**map_map_anytype** | [**STRING_TABLE[STRING_TABLE[ANY]]**](STRING_TABLE.md) | | [optional] [default to null] -**anytype_1** | [**ANY**](.md) | | [optional] [default to null] -**anytype_2** | [**ANY**](.md) | | [optional] [default to null] -**anytype_3** | [**ANY**](.md) | | [optional] [default to null] +**map_property** | [**STRING_TABLE[STRING_32]**](STRING_32.md) | | [optional] [default to null] +**map_of_map_property** | [**STRING_TABLE[STRING_TABLE[STRING_32]]**](STRING_TABLE.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/ANOTHERFAKE_API.md b/samples/client/petstore/eiffel/docs/ANOTHERFAKE_API.md index 2c1e06ea5c31..fce27e0aa2f2 100644 --- a/samples/client/petstore/eiffel/docs/ANOTHERFAKE_API.md +++ b/samples/client/petstore/eiffel/docs/ANOTHERFAKE_API.md @@ -4,23 +4,23 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- -[**123_test_special_tags**](ANOTHERFAKE_API.md#123_test_special_tags) | **Patch** /another-fake/dummy | To test special tags +[**test_special_tags**](ANOTHERFAKE_API.md#test_special_tags) | **Patch** /another-fake/dummy | To test special tags -# **123_test_special_tags** -> 123_test_special_tags (body: CLIENT ): detachable CLIENT +# **test_special_tags** +> test_special_tags (client: CLIENT ): detachable CLIENT To test special tags -To test special tags and operation ID starting with number +To test special tags ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**CLIENT**](CLIENT.md)| client model | + **client** | [**CLIENT**](CLIENT.md)| client model | ### Return type diff --git a/samples/client/petstore/eiffel/docs/CATEGORY.md b/samples/client/petstore/eiffel/docs/CATEGORY.md index 9f076ba276d0..de2ce34e6272 100644 --- a/samples/client/petstore/eiffel/docs/CATEGORY.md +++ b/samples/client/petstore/eiffel/docs/CATEGORY.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **INTEGER_64** | | [optional] [default to null] -**name** | [**STRING_32**](STRING_32.md) | | [default to default-name] +**name** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/FAKECLASSNAMETAGS123_API.md b/samples/client/petstore/eiffel/docs/FAKECLASSNAMETAGS123_API.md index 3ae91b654c26..26344acdb285 100644 --- a/samples/client/petstore/eiffel/docs/FAKECLASSNAMETAGS123_API.md +++ b/samples/client/petstore/eiffel/docs/FAKECLASSNAMETAGS123_API.md @@ -8,7 +8,7 @@ Feature | HTTP request | Description # **test_classname** -> test_classname (body: CLIENT ): detachable CLIENT +> test_classname (client: CLIENT ): detachable CLIENT To test class name in snake case @@ -20,7 +20,7 @@ To test class name in snake case Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**CLIENT**](CLIENT.md)| client model | + **client** | [**CLIENT**](CLIENT.md)| client model | ### Return type diff --git a/samples/client/petstore/eiffel/docs/FAKE_API.md b/samples/client/petstore/eiffel/docs/FAKE_API.md index d73b50161b59..94888d077727 100644 --- a/samples/client/petstore/eiffel/docs/FAKE_API.md +++ b/samples/client/petstore/eiffel/docs/FAKE_API.md @@ -4,52 +4,18 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Feature | HTTP request | Description ------------- | ------------- | ------------- -[**create_xml_item**](FAKE_API.md#create_xml_item) | **Post** /fake/create_xml_item | creates an XmlItem [**fake_outer_boolean_serialize**](FAKE_API.md#fake_outer_boolean_serialize) | **Post** /fake/outer/boolean | [**fake_outer_composite_serialize**](FAKE_API.md#fake_outer_composite_serialize) | **Post** /fake/outer/composite | [**fake_outer_number_serialize**](FAKE_API.md#fake_outer_number_serialize) | **Post** /fake/outer/number | [**fake_outer_string_serialize**](FAKE_API.md#fake_outer_string_serialize) | **Post** /fake/outer/string | -[**test_body_with_file_schema**](FAKE_API.md#test_body_with_file_schema) | **Put** /fake/body-with-file-schema | [**test_body_with_query_params**](FAKE_API.md#test_body_with_query_params) | **Put** /fake/body-with-query-params | [**test_client_model**](FAKE_API.md#test_client_model) | **Patch** /fake | To test \"client\" model -[**test_endpoint_parameters**](FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**test_endpoint_parameters**](FAKE_API.md#test_endpoint_parameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FAKE_API.md#test_enum_parameters) | **Get** /fake | To test enum parameters -[**test_group_parameters**](FAKE_API.md#test_group_parameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FAKE_API.md#test_inline_additional_properties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FAKE_API.md#test_json_form_data) | **Get** /fake/jsonFormData | test json serialization of form data -[**test_query_parameter_collection_format**](FAKE_API.md#test_query_parameter_collection_format) | **Put** /fake/test-query-paramters | -# **create_xml_item** -> create_xml_item (xml_item: XML_ITEM ) - - -creates an XmlItem - -this route creates an XmlItem - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xml_item** | [**XML_ITEM**](XML_ITEM.md)| XmlItem Body | - -### Return type - -{empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **fake_outer_boolean_serialize** > fake_outer_boolean_serialize (body: detachable BOOLEAN ): detachable BOOLEAN @@ -81,7 +47,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **fake_outer_composite_serialize** -> fake_outer_composite_serialize (body: detachable OUTER_COMPOSITE ): detachable OUTER_COMPOSITE +> fake_outer_composite_serialize (outer_composite: detachable OUTER_COMPOSITE ): detachable OUTER_COMPOSITE @@ -93,7 +59,7 @@ Test serialization of object with outer number type Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OUTER_COMPOSITE**](OUTER_COMPOSITE.md)| Input composite as post body | [optional] + **outer_composite** | [**OUTER_COMPOSITE**](OUTER_COMPOSITE.md)| Input composite as post body | [optional] ### Return type @@ -170,38 +136,8 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **test_body_with_file_schema** -> test_body_with_file_schema (body: FILE_SCHEMA_TEST_CLASS ) - - - - -For this test, the body for this request much reference a schema named `File`. - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FILE_SCHEMA_TEST_CLASS**](FILE_SCHEMA_TEST_CLASS.md)| | - -### Return type - -{empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **test_body_with_query_params** -> test_body_with_query_params (query: STRING_32 ; body: USER ) +> test_body_with_query_params (query: STRING_32 ; user: USER ) @@ -211,8 +147,8 @@ No authorization required Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **query** | **STRING_32**| | [default to null] - **body** | [**USER**](USER.md)| | + **query** | **STRING_32**| | + **user** | [**USER**](USER.md)| | ### Return type @@ -230,7 +166,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_client_model** -> test_client_model (body: CLIENT ): detachable CLIENT +> test_client_model (client: CLIENT ): detachable CLIENT To test \"client\" model @@ -242,7 +178,7 @@ To test \"client\" model Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**CLIENT**](CLIENT.md)| client model | + **client** | [**CLIENT**](CLIENT.md)| client model | ### Return type @@ -260,12 +196,12 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_endpoint_parameters** -> test_endpoint_parameters (number: REAL_32 ; double: REAL_64 ; pattern_without_delimiter: STRING_32 ; byte: ARRAY [NATURAL_8] ; integer: detachable INTEGER_32 ; int32: detachable INTEGER_32 ; int64: detachable INTEGER_64 ; float: detachable REAL_32 ; string: detachable STRING_32 ; binary: detachable FILE ; date: detachable DATE ; date_time: detachable DATE_TIME ; password: detachable STRING ; callback: detachable STRING_32 ) +> test_endpoint_parameters (number: REAL_32 ; double: REAL_64 ; pattern_without_delimiter: STRING_32 ; byte: ARRAY [NATURAL_8] ; integer: detachable INTEGER_32 ; int32: detachable INTEGER_32 ; int64: detachable INTEGER_64 ; float: detachable REAL_32 ; string: detachable STRING_32 ; binary: detachable FILE ; date: detachable DATE ; date_time: detachable DATE_TIME ; password: detachable STRING_32 ; callback: detachable STRING_32 ) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Parameters @@ -284,7 +220,7 @@ Name | Type | Description | Notes **binary** | **FILE**| None | [optional] [default to null] **date** | **DATE**| None | [optional] [default to null] **date_time** | **DATE_TIME**| None | [optional] [default to null] - **password** | **STRING**| None | [optional] [default to null] + **password** | **STRING_32**| None | [optional] [default to null] **callback** | **STRING_32**| None | [optional] [default to null] ### Return type @@ -315,13 +251,13 @@ To test enum parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Header parameter enum test (string array) | [optional] [default to null] + **enum_header_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Header parameter enum test (string array) | [optional] **enum_header_string** | **STRING_32**| Header parameter enum test (string) | [optional] [default to -efg] - **enum_query_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Query parameter enum test (string array) | [optional] [default to null] + **enum_query_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Query parameter enum test (string array) | [optional] **enum_query_string** | **STRING_32**| Query parameter enum test (string) | [optional] [default to -efg] - **enum_query_integer** | **INTEGER_32**| Query parameter enum test (double) | [optional] [default to null] - **enum_query_double** | **REAL_64**| Query parameter enum test (double) | [optional] [default to null] - **enum_form_string_array** | [**LIST [STRING_32]**](STRING_32.md)| Form parameter enum test (string array) | [optional] [default to $] + **enum_query_integer** | **INTEGER_32**| Query parameter enum test (double) | [optional] + **enum_query_double** | **REAL_64**| Query parameter enum test (double) | [optional] + **enum_form_string_array** | **LIST [STRING_32]**| Form parameter enum test (string array) | [optional] [default to $] **enum_form_string** | **STRING_32**| Form parameter enum test (string) | [optional] [default to -efg] ### Return type @@ -339,43 +275,8 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **test_group_parameters** -> test_group_parameters (required_string_group: INTEGER_32 ; required_boolean_group: BOOLEAN ; required_int64_group: INTEGER_64 ; string_group: detachable INTEGER_32 ; boolean_group: detachable BOOLEAN ; int64_group: detachable INTEGER_64 ) - - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **required_string_group** | **INTEGER_32**| Required String in group parameters | [default to null] - **required_boolean_group** | **BOOLEAN**| Required Boolean in group parameters | [default to null] - **required_int64_group** | **INTEGER_64**| Required Integer in group parameters | [default to null] - **string_group** | **INTEGER_32**| String in group parameters | [optional] [default to null] - **boolean_group** | **BOOLEAN**| Boolean in group parameters | [optional] [default to null] - **int64_group** | **INTEGER_64**| Integer in group parameters | [optional] [default to null] - -### Return type - -{empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **test_inline_additional_properties** -> test_inline_additional_properties (param: STRING_TABLE[STRING_32] ) +> test_inline_additional_properties (request_body: STRING_TABLE[STRING_32] ) test inline additionalProperties @@ -385,7 +286,7 @@ test inline additionalProperties Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**STRING_TABLE[STRING_32]**](STRING_32.md)| request body | + **request_body** | [**STRING_TABLE[STRING_32]**](STRING_32.md)| request body | ### Return type @@ -431,37 +332,3 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **test_query_parameter_collection_format** -> test_query_parameter_collection_format (pipe: LIST [STRING_32] ; ioutil: LIST [STRING_32] ; http: LIST [STRING_32] ; url: LIST [STRING_32] ; context: LIST [STRING_32] ) - - - - -To test the collection format in query parameters - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**LIST [STRING_32]**](STRING_32.md)| | [default to null] - **ioutil** | [**LIST [STRING_32]**](STRING_32.md)| | [default to null] - **http** | [**LIST [STRING_32]**](STRING_32.md)| | [default to null] - **url** | [**LIST [STRING_32]**](STRING_32.md)| | [default to null] - **context** | [**LIST [STRING_32]**](STRING_32.md)| | [default to null] - -### Return type - -{empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/eiffel/docs/FORMAT_TEST.md b/samples/client/petstore/eiffel/docs/FORMAT_TEST.md index bb48e3e04dfd..bb634fd99bf6 100644 --- a/samples/client/petstore/eiffel/docs/FORMAT_TEST.md +++ b/samples/client/petstore/eiffel/docs/FORMAT_TEST.md @@ -15,8 +15,7 @@ Name | Type | Description | Notes **date** | [**DATE**](DATE.md) | | [default to null] **date_time** | [**DATE_TIME**](DATE_TIME.md) | | [optional] [default to null] **uuid** | [**UUID**](UUID.md) | | [optional] [default to null] -**password** | [**STRING**](STRING.md) | | [default to null] -**big_decimal** | [**BIG_DECIMAL**](BigDecimal.md) | | [optional] [default to null] +**password** | [**STRING_32**](STRING_32.md) | | [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/HAS_ONLY_READ_ONLY.md b/samples/client/petstore/eiffel/docs/HAS_ONLY_READ_ONLY.md index 100044b32ae7..3a786e9dcbac 100644 --- a/samples/client/petstore/eiffel/docs/HAS_ONLY_READ_ONLY.md +++ b/samples/client/petstore/eiffel/docs/HAS_ONLY_READ_ONLY.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**bar** | [**STRING_32**](STRING_32.md) | | [optional] [readonly] [default to null] -**foo** | [**STRING_32**](STRING_32.md) | | [optional] [readonly] [default to null] +**bar** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] +**foo** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/MAP_TEST.md b/samples/client/petstore/eiffel/docs/MAP_TEST.md index a4f5fbd8cc4c..e55324372cbc 100644 --- a/samples/client/petstore/eiffel/docs/MAP_TEST.md +++ b/samples/client/petstore/eiffel/docs/MAP_TEST.md @@ -5,8 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **map_map_of_string** | [**STRING_TABLE[STRING_TABLE[STRING_32]]**](STRING_TABLE.md) | | [optional] [default to null] **map_of_enum_string** | [**STRING_TABLE[STRING_32]**](STRING_32.md) | | [optional] [default to null] -**direct_map** | **STRING_TABLE[BOOLEAN]** | | [optional] [default to null] -**indirect_map** | **STRING_TABLE[BOOLEAN]** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/NAME.md b/samples/client/petstore/eiffel/docs/NAME.md index c19aab7e3b52..7ed9b079b81b 100644 --- a/samples/client/petstore/eiffel/docs/NAME.md +++ b/samples/client/petstore/eiffel/docs/NAME.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **INTEGER_32** | | [default to null] -**snake_case** | **INTEGER_32** | | [optional] [readonly] [default to null] +**snake_case** | **INTEGER_32** | | [optional] [default to null] **property** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] -**var_123_number** | **INTEGER_32** | | [optional] [readonly] [default to null] +**var_123_number** | **INTEGER_32** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/PET_API.md b/samples/client/petstore/eiffel/docs/PET_API.md index c12e549eeae3..2bd3122ea68b 100644 --- a/samples/client/petstore/eiffel/docs/PET_API.md +++ b/samples/client/petstore/eiffel/docs/PET_API.md @@ -12,11 +12,10 @@ Feature | HTTP request | Description [**update_pet**](PET_API.md#update_pet) | **Put** /pet | Update an existing pet [**update_pet_with_form**](PET_API.md#update_pet_with_form) | **Post** /pet/{petId} | Updates a pet in the store with form data [**upload_file**](PET_API.md#upload_file) | **Post** /pet/{petId}/uploadImage | uploads an image -[**upload_file_with_required_file**](PET_API.md#upload_file_with_required_file) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) # **add_pet** -> add_pet (body: PET ) +> add_pet (pet: PET ) Add a new pet to the store @@ -26,7 +25,7 @@ Add a new pet to the store Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**PET**](PET.md)| Pet object that needs to be added to the store | + **pet** | [**PET**](PET.md)| Pet object that needs to be added to the store | ### Return type @@ -54,8 +53,8 @@ Deletes a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| Pet id to delete | [default to null] - **api_key** | **STRING_32**| | [optional] [default to null] + **pet_id** | **INTEGER_64**| Pet id to delete | + **api_key** | **STRING_32**| | [optional] ### Return type @@ -85,7 +84,7 @@ Multiple status values can be provided with comma separated strings Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**LIST [STRING_32]**](STRING_32.md)| Status values that need to be considered for filter | [default to null] + **status** | [**LIST [STRING_32]**](STRING_32.md)| Status values that need to be considered for filter | ### Return type @@ -115,7 +114,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**LIST [STRING_32]**](STRING_32.md)| Tags to filter by | [default to null] + **tags** | [**LIST [STRING_32]**](STRING_32.md)| Tags to filter by | ### Return type @@ -145,7 +144,7 @@ Returns a single pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet to return | [default to null] + **pet_id** | **INTEGER_64**| ID of pet to return | ### Return type @@ -163,7 +162,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_pet** -> update_pet (body: PET ) +> update_pet (pet: PET ) Update an existing pet @@ -173,7 +172,7 @@ Update an existing pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**PET**](PET.md)| Pet object that needs to be added to the store | + **pet** | [**PET**](PET.md)| Pet object that needs to be added to the store | ### Return type @@ -201,7 +200,7 @@ Updates a pet in the store with form data Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet that needs to be updated | [default to null] + **pet_id** | **INTEGER_64**| ID of pet that needs to be updated | **name** | **STRING_32**| Updated name of the pet | [optional] [default to null] **status** | **STRING_32**| Updated status of the pet | [optional] [default to null] @@ -231,7 +230,7 @@ uploads an image Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet to update | [default to null] + **pet_id** | **INTEGER_64**| ID of pet to update | **additional_metadata** | **STRING_32**| Additional data to pass to server | [optional] [default to null] **file** | **FILE**| file to upload | [optional] [default to null] @@ -250,33 +249,3 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **upload_file_with_required_file** -> upload_file_with_required_file (pet_id: INTEGER_64 ; required_file: FILE ; additional_metadata: detachable STRING_32 ): detachable API_RESPONSE - - -uploads an image (required) - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **INTEGER_64**| ID of pet to update | [default to null] - **required_file** | **FILE**| file to upload | [default to null] - **additional_metadata** | **STRING_32**| Additional data to pass to server | [optional] [default to null] - -### Return type - -[**API_RESPONSE**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/eiffel/docs/READ_ONLY_FIRST.md b/samples/client/petstore/eiffel/docs/READ_ONLY_FIRST.md index b0ec1c28b3ab..f6732bf11ef3 100644 --- a/samples/client/petstore/eiffel/docs/READ_ONLY_FIRST.md +++ b/samples/client/petstore/eiffel/docs/READ_ONLY_FIRST.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**bar** | [**STRING_32**](STRING_32.md) | | [optional] [readonly] [default to null] +**bar** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] **baz** | [**STRING_32**](STRING_32.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/eiffel/docs/STORE_API.md b/samples/client/petstore/eiffel/docs/STORE_API.md index 7c081dac4ae8..c851de646130 100644 --- a/samples/client/petstore/eiffel/docs/STORE_API.md +++ b/samples/client/petstore/eiffel/docs/STORE_API.md @@ -23,7 +23,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **STRING_32**| ID of the order that needs to be deleted | [default to null] + **order_id** | **STRING_32**| ID of the order that needs to be deleted | ### Return type @@ -80,7 +80,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **INTEGER_64**| ID of pet that needs to be fetched | [default to null] + **order_id** | **INTEGER_64**| ID of pet that needs to be fetched | ### Return type @@ -98,7 +98,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **place_order** -> place_order (body: ORDER ): detachable ORDER +> place_order (order: ORDER ): detachable ORDER Place an order for a pet @@ -108,7 +108,7 @@ Place an order for a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ORDER**](ORDER.md)| order placed for purchasing the pet | + **order** | [**ORDER**](ORDER.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/eiffel/docs/USER_API.md b/samples/client/petstore/eiffel/docs/USER_API.md index 8c3bb38bd920..686b13789fdf 100644 --- a/samples/client/petstore/eiffel/docs/USER_API.md +++ b/samples/client/petstore/eiffel/docs/USER_API.md @@ -15,7 +15,7 @@ Feature | HTTP request | Description # **create_user** -> create_user (body: USER ) +> create_user (user: USER ) Create user @@ -27,7 +27,7 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**USER**](USER.md)| Created user object | + **user** | [**USER**](USER.md)| Created user object | ### Return type @@ -45,7 +45,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_array_input** -> create_users_with_array_input (body: LIST [USER] ) +> create_users_with_array_input (user: LIST [USER] ) Creates list of users with given input array @@ -55,7 +55,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**LIST [USER]**](User.md)| List of user object | + **user** | [**LIST [USER]**](LIST.md)| List of user object | ### Return type @@ -73,7 +73,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_list_input** -> create_users_with_list_input (body: LIST [USER] ) +> create_users_with_list_input (user: LIST [USER] ) Creates list of users with given input array @@ -83,7 +83,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**LIST [USER]**](User.md)| List of user object | + **user** | [**LIST [USER]**](LIST.md)| List of user object | ### Return type @@ -113,7 +113,7 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The name that needs to be deleted | [default to null] + **username** | **STRING_32**| The name that needs to be deleted | ### Return type @@ -141,8 +141,8 @@ Logs user into the system Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The user name for login | [default to null] - **password** | **STRING_32**| The password for login in clear text | [default to null] + **username** | **STRING_32**| The user name for login | + **password** | **STRING_32**| The password for login in clear text | ### Return type @@ -185,7 +185,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_user** -> update_user (username: STRING_32 ; body: USER ) +> update_user (username: STRING_32 ; user: USER ) Updated user @@ -197,8 +197,8 @@ This can only be done by the logged in user. Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| name that need to be deleted | [default to null] - **body** | [**USER**](USER.md)| Updated user object | + **username** | **STRING_32**| name that need to be deleted | + **user** | [**USER**](USER.md)| Updated user object | ### Return type @@ -226,7 +226,7 @@ Get user by user name Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **STRING_32**| The name that needs to be fetched. Use user1 for testing. | [default to null] + **username** | **STRING_32**| The name that needs to be fetched. Use user1 for testing. | ### Return type diff --git a/samples/client/petstore/eiffel/src/api/another_fake_api.e b/samples/client/petstore/eiffel/src/api/another_fake_api.e index 91ac69abea51..0a912d7f8197 100644 --- a/samples/client/petstore/eiffel/src/api/another_fake_api.e +++ b/samples/client/petstore/eiffel/src/api/another_fake_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - 123_test_special_tags (body: CLIENT): detachable CLIENT + test_special_tags (client: CLIENT): detachable CLIENT + -- To test special tags -- To test special tags - -- To test special tags and operation ID starting with number -- - -- argument: body client model (required) + -- argument: client client model (required) -- -- -- Result CLIENT @@ -40,7 +40,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(client) l_path := "/another-fake/dummy" diff --git a/samples/client/petstore/eiffel/src/api/fake_api.e b/samples/client/petstore/eiffel/src/api/fake_api.e index 05cd7a9c5031..6e7a054c2bdc 100644 --- a/samples/client/petstore/eiffel/src/api/fake_api.e +++ b/samples/client/petstore/eiffel/src/api/fake_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,36 +24,6 @@ inherit feature -- API Access - create_xml_item (xml_item: XML_ITEM) - -- creates an XmlItem - -- this route creates an XmlItem - -- - -- argument: xml_item XmlItem Body (required) - -- - -- - require - local - l_path: STRING - l_request: API_CLIENT_REQUEST - l_response: API_CLIENT_RESPONSE - do - reset_error - create l_request - l_request.set_body(xml_item) - l_path := "/fake/create_xml_item" - - - if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then - l_request.add_header(l_accept,"Accept"); - end - l_request.add_header(api_client.select_header_content_type (<<"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16">>),"Content-Type") - l_request.set_auth_names (<<>>) - l_response := api_client.call_api (l_path, "Post", l_request, agent serializer, Void) - if l_response.has_error then - last_error := l_response.error - end - end - fake_outer_boolean_serialize (body: BOOLEAN): detachable BOOLEAN -- -- Test serialization of outer boolean types @@ -89,11 +59,11 @@ feature -- API Access end end - fake_outer_composite_serialize (body: detachable OUTER_COMPOSITE): detachable OUTER_COMPOSITE + fake_outer_composite_serialize (outer_composite: detachable OUTER_COMPOSITE): detachable OUTER_COMPOSITE -- -- Test serialization of object with outer number type -- - -- argument: body Input composite as post body (optional) + -- argument: outer_composite Input composite as post body (optional) -- -- -- Result OUTER_COMPOSITE @@ -105,7 +75,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(outer_composite) l_path := "/fake/outer/composite" @@ -194,43 +164,13 @@ feature -- API Access end end - test_body_with_file_schema (body: FILE_SCHEMA_TEST_CLASS) - -- - -- For this test, the body for this request much reference a schema named `File`. - -- - -- argument: body (required) - -- - -- - require - local - l_path: STRING - l_request: API_CLIENT_REQUEST - l_response: API_CLIENT_RESPONSE - do - reset_error - create l_request - l_request.set_body(body) - l_path := "/fake/body-with-file-schema" - - - if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then - l_request.add_header(l_accept,"Accept"); - end - l_request.add_header(api_client.select_header_content_type (<<"application/json">>),"Content-Type") - l_request.set_auth_names (<<>>) - l_response := api_client.call_api (l_path, "Put", l_request, agent serializer, Void) - if l_response.has_error then - last_error := l_response.error - end - end - - test_body_with_query_params (query: STRING_32; body: USER) + test_body_with_query_params (query: STRING_32; user: USER) -- -- -- -- argument: query (required) -- - -- argument: body (required) + -- argument: user (required) -- -- require @@ -241,7 +181,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(user) l_path := "/fake/body-with-query-params" l_request.fill_query_params(api_client.parameter_to_tuple("", "query", query)); @@ -257,11 +197,11 @@ feature -- API Access end end - test_client_model (body: CLIENT): detachable CLIENT + test_client_model (client: CLIENT): detachable CLIENT -- To test \"client\" model -- To test \"client\" model -- - -- argument: body client model (required) + -- argument: client client model (required) -- -- -- Result CLIENT @@ -273,7 +213,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(client) l_path := "/fake" @@ -292,9 +232,9 @@ feature -- API Access end end - test_endpoint_parameters (number: REAL_32; double: REAL_64; pattern_without_delimiter: STRING_32; byte: ARRAY [NATURAL_8]; integer: INTEGER_32; int32: INTEGER_32; int64: INTEGER_64; float: REAL_32; string: STRING_32; binary: FILE; date: DATE; date_time: DATE_TIME; password: STRING; callback: STRING_32) - -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + test_endpoint_parameters (number: REAL_32; double: REAL_64; pattern_without_delimiter: STRING_32; byte: ARRAY [NATURAL_8]; integer: INTEGER_32; int32: INTEGER_32; int64: INTEGER_64; float: REAL_32; string: STRING_32; binary: FILE; date: DATE; date_time: DATE_TIME; password: STRING_32; callback: STRING_32) + -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -- -- argument: number None (required) -- @@ -399,21 +339,21 @@ feature -- API Access end end - test_enum_parameters (enum_header_string_array: detachable LIST [STRING_32]; enum_header_string: STRING_32; enum_query_string_array: detachable LIST [STRING_32]; enum_query_string: STRING_32; enum_query_integer: INTEGER_32; enum_query_double: REAL_64; enum_form_string_array: detachable LIST [STRING_32]; enum_form_string: STRING_32) + test_enum_parameters (enum_header_string_array: detachable LIST [STRING_32]; enum_header_string: STRING_32; enum_query_string_array: detachable LIST [STRING_32]; enum_query_string: STRING_32; enum_query_integer: INTEGER_32; enum_query_double: REAL_64; enum_form_string_array: LIST [STRING_32]; enum_form_string: STRING_32) -- To test enum parameters -- To test enum parameters -- - -- argument: enum_header_string_array Header parameter enum test (string array) (optional, default to null) + -- argument: enum_header_string_array Header parameter enum test (string array) (optional) -- -- argument: enum_header_string Header parameter enum test (string) (optional, default to -efg) -- - -- argument: enum_query_string_array Query parameter enum test (string array) (optional, default to null) + -- argument: enum_query_string_array Query parameter enum test (string array) (optional) -- -- argument: enum_query_string Query parameter enum test (string) (optional, default to -efg) -- - -- argument: enum_query_integer Query parameter enum test (double) (optional, default to null) + -- argument: enum_query_integer Query parameter enum test (double) (optional) -- - -- argument: enum_query_double Query parameter enum test (double) (optional, default to null) + -- argument: enum_query_double Query parameter enum test (double) (optional) -- -- argument: enum_form_string_array Form parameter enum test (string array) (optional, default to $) -- @@ -459,61 +399,11 @@ feature -- API Access end end - test_group_parameters (required_string_group: INTEGER_32; required_boolean_group: BOOLEAN; required_int64_group: INTEGER_64; string_group: INTEGER_32; boolean_group: BOOLEAN; int64_group: INTEGER_64) - -- Fake endpoint to test group parameters (optional) - -- Fake endpoint to test group parameters (optional) - -- - -- argument: required_string_group Required String in group parameters (required) - -- - -- argument: required_boolean_group Required Boolean in group parameters (required) - -- - -- argument: required_int64_group Required Integer in group parameters (required) - -- - -- argument: string_group String in group parameters (optional, default to null) - -- - -- argument: boolean_group Boolean in group parameters (optional, default to null) - -- - -- argument: int64_group Integer in group parameters (optional, default to null) - -- - -- - require - local - l_path: STRING - l_request: API_CLIENT_REQUEST - l_response: API_CLIENT_RESPONSE - do - reset_error - create l_request - - l_path := "/fake" - l_request.fill_query_params(api_client.parameter_to_tuple("", "required_string_group", required_string_group)); - l_request.fill_query_params(api_client.parameter_to_tuple("", "required_int64_group", required_int64_group)); - l_request.fill_query_params(api_client.parameter_to_tuple("", "string_group", string_group)); - l_request.fill_query_params(api_client.parameter_to_tuple("", "int64_group", int64_group)); - - if attached required_boolean_group as l_required_boolean_group then - l_request.add_header(l_required_boolean_group.out,"required_boolean_group"); - end - if attached boolean_group as l_boolean_group then - l_request.add_header(l_boolean_group.out,"boolean_group"); - end - - if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then - l_request.add_header(l_accept,"Accept"); - end - l_request.add_header(api_client.select_header_content_type (<<>>),"Content-Type") - l_request.set_auth_names (<<>>) - l_response := api_client.call_api (l_path, "Delete", l_request, agent serializer, Void) - if l_response.has_error then - last_error := l_response.error - end - end - - test_inline_additional_properties (param: STRING_TABLE[STRING_32]) + test_inline_additional_properties (request_body: STRING_TABLE[STRING_32]) -- test inline additionalProperties -- -- - -- argument: param request body (required) + -- argument: request_body request body (required) -- -- require @@ -524,7 +414,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(param) + l_request.set_body(request_body) l_path := "/fake/inline-additionalProperties" @@ -577,48 +467,5 @@ feature -- API Access end end - test_query_parameter_collection_format (pipe: LIST [STRING_32]; ioutil: LIST [STRING_32]; http: LIST [STRING_32]; url: LIST [STRING_32]; context: LIST [STRING_32]) - -- - -- To test the collection format in query parameters - -- - -- argument: pipe (required) - -- - -- argument: ioutil (required) - -- - -- argument: http (required) - -- - -- argument: url (required) - -- - -- argument: context (required) - -- - -- - require - local - l_path: STRING - l_request: API_CLIENT_REQUEST - l_response: API_CLIENT_RESPONSE - do - reset_error - create l_request - - l_path := "/fake/test-query-paramters" - l_request.fill_query_params(api_client.parameter_to_tuple("csv", "pipe", pipe)); - l_request.fill_query_params(api_client.parameter_to_tuple("csv", "ioutil", ioutil)); - l_request.fill_query_params(api_client.parameter_to_tuple("ssv", "http", http)); - l_request.fill_query_params(api_client.parameter_to_tuple("csv", "url", url)); - l_request.fill_query_params(api_client.parameter_to_tuple("multi", "context", context)); - - - if attached {STRING} api_client.select_header_accept (<<>>) as l_accept then - l_request.add_header(l_accept,"Accept"); - end - l_request.add_header(api_client.select_header_content_type (<<>>),"Content-Type") - l_request.set_auth_names (<<>>) - l_response := api_client.call_api (l_path, "Put", l_request, agent serializer, Void) - if l_response.has_error then - last_error := l_response.error - end - end - end diff --git a/samples/client/petstore/eiffel/src/api/fake_classname_tags123_api.e b/samples/client/petstore/eiffel/src/api/fake_classname_tags123_api.e index 51544cb912f5..de7f29df8af5 100644 --- a/samples/client/petstore/eiffel/src/api/fake_classname_tags123_api.e +++ b/samples/client/petstore/eiffel/src/api/fake_classname_tags123_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - test_classname (body: CLIENT): detachable CLIENT + test_classname (client: CLIENT): detachable CLIENT -- To test class name in snake case -- To test class name in snake case -- - -- argument: body client model (required) + -- argument: client client model (required) -- -- -- Result CLIENT @@ -40,7 +40,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(client) l_path := "/fake_classname_test" diff --git a/samples/client/petstore/eiffel/src/api/pet_api.e b/samples/client/petstore/eiffel/src/api/pet_api.e index 9d0a9967dfd4..17a482737ed5 100644 --- a/samples/client/petstore/eiffel/src/api/pet_api.e +++ b/samples/client/petstore/eiffel/src/api/pet_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - add_pet (body: PET) + add_pet (pet: PET) -- Add a new pet to the store -- -- - -- argument: body Pet object that needs to be added to the store (required) + -- argument: pet Pet object that needs to be added to the store (required) -- -- require @@ -39,7 +39,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(pet) l_path := "/pet" @@ -60,7 +60,7 @@ feature -- API Access -- -- argument: pet_id Pet id to delete (required) -- - -- argument: api_key (optional, default to null) + -- argument: api_key (optional) -- -- require @@ -198,11 +198,11 @@ feature -- API Access end end - update_pet (body: PET) + update_pet (pet: PET) -- Update an existing pet -- -- - -- argument: body Pet object that needs to be added to the store (required) + -- argument: pet Pet object that needs to be added to the store (required) -- -- require @@ -213,7 +213,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(pet) l_path := "/pet" @@ -315,51 +315,5 @@ feature -- API Access end end - upload_file_with_required_file (pet_id: INTEGER_64; required_file: FILE; additional_metadata: STRING_32): detachable API_RESPONSE - -- uploads an image (required) - -- - -- - -- argument: pet_id ID of pet to update (required) - -- - -- argument: required_file file to upload (required) - -- - -- argument: additional_metadata Additional data to pass to server (optional, default to null) - -- - -- - -- Result API_RESPONSE - require - local - l_path: STRING - l_request: API_CLIENT_REQUEST - l_response: API_CLIENT_RESPONSE - do - reset_error - create l_request - - l_path := "/fake/{petId}/uploadImageWithRequiredFile" - l_path.replace_substring_all ("{"+"petId"+"}", api_client.url_encode (pet_id.out)) - - if attached additional_metadata as l_additional_metadata then - l_request.add_form(l_additional_metadata,"additionalMetadata"); - end - if attached required_file as l_required_file then - l_request.add_form(l_required_file,"requiredFile"); - end - - if attached {STRING} api_client.select_header_accept (<<"application/json">>) as l_accept then - l_request.add_header(l_accept,"Accept"); - end - l_request.add_header(api_client.select_header_content_type (<<"multipart/form-data">>),"Content-Type") - l_request.set_auth_names (<<"petstore_auth">>) - l_response := api_client.call_api (l_path, "Post", l_request, Void, agent deserializer) - if l_response.has_error then - last_error := l_response.error - elseif attached { API_RESPONSE } l_response.data ({ API_RESPONSE }) as l_data then - Result := l_data - else - create last_error.make ("Unknown error: Status response [ " + l_response.status.out + "]") - end - end - end diff --git a/samples/client/petstore/eiffel/src/api/store_api.e b/samples/client/petstore/eiffel/src/api/store_api.e index d5d4177baae0..2f0854b3b391 100644 --- a/samples/client/petstore/eiffel/src/api/store_api.e +++ b/samples/client/petstore/eiffel/src/api/store_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -126,11 +126,11 @@ feature -- API Access end end - place_order (body: ORDER): detachable ORDER + place_order (order: ORDER): detachable ORDER -- Place an order for a pet -- -- - -- argument: body order placed for purchasing the pet (required) + -- argument: order order placed for purchasing the pet (required) -- -- -- Result ORDER @@ -142,7 +142,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(order) l_path := "/store/order" diff --git a/samples/client/petstore/eiffel/src/api/user_api.e b/samples/client/petstore/eiffel/src/api/user_api.e index 7e64a8fa4373..3b5703b40cfb 100644 --- a/samples/client/petstore/eiffel/src/api/user_api.e +++ b/samples/client/petstore/eiffel/src/api/user_api.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,11 +24,11 @@ inherit feature -- API Access - create_user (body: USER) + create_user (user: USER) -- Create user -- This can only be done by the logged in user. -- - -- argument: body Created user object (required) + -- argument: user Created user object (required) -- -- require @@ -39,7 +39,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(user) l_path := "/user" @@ -54,11 +54,11 @@ feature -- API Access end end - create_users_with_array_input (body: LIST [USER]) + create_users_with_array_input (user: LIST [USER]) -- Creates list of users with given input array -- -- - -- argument: body List of user object (required) + -- argument: user List of user object (required) -- -- require @@ -69,7 +69,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(user) l_path := "/user/createWithArray" @@ -84,11 +84,11 @@ feature -- API Access end end - create_users_with_list_input (body: LIST [USER]) + create_users_with_list_input (user: LIST [USER]) -- Creates list of users with given input array -- -- - -- argument: body List of user object (required) + -- argument: user List of user object (required) -- -- require @@ -99,7 +99,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(user) l_path := "/user/createWithList" @@ -212,13 +212,13 @@ feature -- API Access end end - update_user (username: STRING_32; body: USER) + update_user (username: STRING_32; user: USER) -- Updated user -- This can only be done by the logged in user. -- -- argument: username name that need to be deleted (required) -- - -- argument: body Updated user object (required) + -- argument: user Updated user object (required) -- -- require @@ -229,7 +229,7 @@ feature -- API Access do reset_error create l_request - l_request.set_body(body) + l_request.set_body(user) l_path := "/user/{username}" l_path.replace_substring_all ("{"+"username"+"}", api_client.url_encode (username.out)) diff --git a/samples/client/petstore/eiffel/src/api_client.e b/samples/client/petstore/eiffel/src/api_client.e index 47b5fba938b8..6397c4293d65 100644 --- a/samples/client/petstore/eiffel/src/api_client.e +++ b/samples/client/petstore/eiffel/src/api_client.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/additional_properties_class.e b/samples/client/petstore/eiffel/src/domain/additional_properties_class.e index 8e0af3ebc2c8..f11b85fd0073 100644 --- a/samples/client/petstore/eiffel/src/domain/additional_properties_class.e +++ b/samples/client/petstore/eiffel/src/domain/additional_properties_class.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,117 +24,27 @@ inherit feature --Access - map_string: detachable STRING_TABLE[STRING_32] + map_property: detachable STRING_TABLE[STRING_32] - map_number: STRING_TABLE[REAL_32] - - map_integer: STRING_TABLE[INTEGER_32] - - map_boolean: STRING_TABLE[BOOLEAN] - - map_array_integer: detachable STRING_TABLE[LIST [INTEGER_32]] - - map_array_anytype: detachable STRING_TABLE[LIST [ANY]] - - map_map_string: detachable STRING_TABLE[STRING_TABLE[STRING_32]] - - map_map_anytype: detachable STRING_TABLE[STRING_TABLE[ANY]] - - anytype_1: detachable ANY - - anytype_2: detachable ANY - - anytype_3: detachable ANY + map_of_map_property: detachable STRING_TABLE[STRING_TABLE[STRING_32]] feature -- Change Element - set_map_string (a_name: like map_string) - -- Set 'map_string' with 'a_name'. - do - map_string := a_name - ensure - map_string_set: map_string = a_name - end - - set_map_number (a_name: like map_number) - -- Set 'map_number' with 'a_name'. - do - map_number := a_name - ensure - map_number_set: map_number = a_name - end - - set_map_integer (a_name: like map_integer) - -- Set 'map_integer' with 'a_name'. - do - map_integer := a_name - ensure - map_integer_set: map_integer = a_name - end - - set_map_boolean (a_name: like map_boolean) - -- Set 'map_boolean' with 'a_name'. - do - map_boolean := a_name - ensure - map_boolean_set: map_boolean = a_name - end - - set_map_array_integer (a_name: like map_array_integer) - -- Set 'map_array_integer' with 'a_name'. + set_map_property (a_name: like map_property) + -- Set 'map_property' with 'a_name'. do - map_array_integer := a_name + map_property := a_name ensure - map_array_integer_set: map_array_integer = a_name + map_property_set: map_property = a_name end - set_map_array_anytype (a_name: like map_array_anytype) - -- Set 'map_array_anytype' with 'a_name'. + set_map_of_map_property (a_name: like map_of_map_property) + -- Set 'map_of_map_property' with 'a_name'. do - map_array_anytype := a_name + map_of_map_property := a_name ensure - map_array_anytype_set: map_array_anytype = a_name - end - - set_map_map_string (a_name: like map_map_string) - -- Set 'map_map_string' with 'a_name'. - do - map_map_string := a_name - ensure - map_map_string_set: map_map_string = a_name - end - - set_map_map_anytype (a_name: like map_map_anytype) - -- Set 'map_map_anytype' with 'a_name'. - do - map_map_anytype := a_name - ensure - map_map_anytype_set: map_map_anytype = a_name - end - - set_anytype_1 (a_name: like anytype_1) - -- Set 'anytype_1' with 'a_name'. - do - anytype_1 := a_name - ensure - anytype_1_set: anytype_1 = a_name - end - - set_anytype_2 (a_name: like anytype_2) - -- Set 'anytype_2' with 'a_name'. - do - anytype_2 := a_name - ensure - anytype_2_set: anytype_2 = a_name - end - - set_anytype_3 (a_name: like anytype_3) - -- Set 'anytype_3' with 'a_name'. - do - anytype_3 := a_name - ensure - anytype_3_set: anytype_3 = a_name + map_of_map_property_set: map_of_map_property = a_name end @@ -145,81 +55,9 @@ feature -- Change Element do create Result.make_empty Result.append("%Nclass ADDITIONAL_PROPERTIES_CLASS%N") - if attached map_string as l_map_string then - Result.append ("%Nmap_string:") - across l_map_string as ic loop - Result.append ("%N") - Result.append ("key:") - Result.append (ic.key.out) - Result.append (" - ") - Result.append ("val:") - Result.append (ic.item.out) - Result.append ("%N") - end - end - if attached map_number as l_map_number then - Result.append ("%Nmap_number:") - across l_map_number as ic loop - Result.append ("%N") - Result.append ("key:") - Result.append (ic.key.out) - Result.append (" - ") - Result.append ("val:") - Result.append (ic.item.out) - Result.append ("%N") - end - end - if attached map_integer as l_map_integer then - Result.append ("%Nmap_integer:") - across l_map_integer as ic loop - Result.append ("%N") - Result.append ("key:") - Result.append (ic.key.out) - Result.append (" - ") - Result.append ("val:") - Result.append (ic.item.out) - Result.append ("%N") - end - end - if attached map_boolean as l_map_boolean then - Result.append ("%Nmap_boolean:") - across l_map_boolean as ic loop - Result.append ("%N") - Result.append ("key:") - Result.append (ic.key.out) - Result.append (" - ") - Result.append ("val:") - Result.append (ic.item.out) - Result.append ("%N") - end - end - if attached map_array_integer as l_map_array_integer then - Result.append ("%Nmap_array_integer:") - across l_map_array_integer as ic loop - Result.append ("%N") - Result.append ("key:") - Result.append (ic.key.out) - Result.append (" - ") - Result.append ("val:") - Result.append (ic.item.out) - Result.append ("%N") - end - end - if attached map_array_anytype as l_map_array_anytype then - Result.append ("%Nmap_array_anytype:") - across l_map_array_anytype as ic loop - Result.append ("%N") - Result.append ("key:") - Result.append (ic.key.out) - Result.append (" - ") - Result.append ("val:") - Result.append (ic.item.out) - Result.append ("%N") - end - end - if attached map_map_string as l_map_map_string then - Result.append ("%Nmap_map_string:") - across l_map_map_string as ic loop + if attached map_property as l_map_property then + Result.append ("%Nmap_property:") + across l_map_property as ic loop Result.append ("%N") Result.append ("key:") Result.append (ic.key.out) @@ -229,9 +67,9 @@ feature -- Change Element Result.append ("%N") end end - if attached map_map_anytype as l_map_map_anytype then - Result.append ("%Nmap_map_anytype:") - across l_map_map_anytype as ic loop + if attached map_of_map_property as l_map_of_map_property then + Result.append ("%Nmap_of_map_property:") + across l_map_of_map_property as ic loop Result.append ("%N") Result.append ("key:") Result.append (ic.key.out) @@ -241,21 +79,6 @@ feature -- Change Element Result.append ("%N") end end - if attached anytype_1 as l_anytype_1 then - Result.append ("%Nanytype_1:") - Result.append (l_anytype_1.out) - Result.append ("%N") - end - if attached anytype_2 as l_anytype_2 then - Result.append ("%Nanytype_2:") - Result.append (l_anytype_2.out) - Result.append ("%N") - end - if attached anytype_3 as l_anytype_3 then - Result.append ("%Nanytype_3:") - Result.append (l_anytype_3.out) - Result.append ("%N") - end end end diff --git a/samples/client/petstore/eiffel/src/domain/animal.e b/samples/client/petstore/eiffel/src/domain/animal.e index 4d5f28f87198..72fa473c5a0e 100644 --- a/samples/client/petstore/eiffel/src/domain/animal.e +++ b/samples/client/petstore/eiffel/src/domain/animal.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/api_response.e b/samples/client/petstore/eiffel/src/domain/api_response.e index a88da23e821a..8b3e64ff0467 100644 --- a/samples/client/petstore/eiffel/src/domain/api_response.e +++ b/samples/client/petstore/eiffel/src/domain/api_response.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/array_of_array_of_number_only.e b/samples/client/petstore/eiffel/src/domain/array_of_array_of_number_only.e index f0d431208be3..b261e583d68a 100644 --- a/samples/client/petstore/eiffel/src/domain/array_of_array_of_number_only.e +++ b/samples/client/petstore/eiffel/src/domain/array_of_array_of_number_only.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/array_of_number_only.e b/samples/client/petstore/eiffel/src/domain/array_of_number_only.e index 611adaf481e9..5a37891c5002 100644 --- a/samples/client/petstore/eiffel/src/domain/array_of_number_only.e +++ b/samples/client/petstore/eiffel/src/domain/array_of_number_only.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/array_test.e b/samples/client/petstore/eiffel/src/domain/array_test.e index 7a8d26ad4d40..a0c54fcf6feb 100644 --- a/samples/client/petstore/eiffel/src/domain/array_test.e +++ b/samples/client/petstore/eiffel/src/domain/array_test.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/capitalization.e b/samples/client/petstore/eiffel/src/domain/capitalization.e index 04eb0f9fbe21..b5b4c5b238a4 100644 --- a/samples/client/petstore/eiffel/src/domain/capitalization.e +++ b/samples/client/petstore/eiffel/src/domain/capitalization.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/cat.e b/samples/client/petstore/eiffel/src/domain/cat.e index 2dd7e4d5149f..c041e4d8db55 100644 --- a/samples/client/petstore/eiffel/src/domain/cat.e +++ b/samples/client/petstore/eiffel/src/domain/cat.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/category.e b/samples/client/petstore/eiffel/src/domain/category.e index 73b059252de8..8bd714c7261c 100644 --- a/samples/client/petstore/eiffel/src/domain/category.e +++ b/samples/client/petstore/eiffel/src/domain/category.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/class_model.e b/samples/client/petstore/eiffel/src/domain/class_model.e index fb1f96792972..711a9a568445 100644 --- a/samples/client/petstore/eiffel/src/domain/class_model.e +++ b/samples/client/petstore/eiffel/src/domain/class_model.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/client.e b/samples/client/petstore/eiffel/src/domain/client.e index dad51e110e55..666e391e516c 100644 --- a/samples/client/petstore/eiffel/src/domain/client.e +++ b/samples/client/petstore/eiffel/src/domain/client.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/dog.e b/samples/client/petstore/eiffel/src/domain/dog.e index 5cd110fe11d3..120d8b86f9c3 100644 --- a/samples/client/petstore/eiffel/src/domain/dog.e +++ b/samples/client/petstore/eiffel/src/domain/dog.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/enum_arrays.e b/samples/client/petstore/eiffel/src/domain/enum_arrays.e index 7f3348347519..ddb0fd5594b2 100644 --- a/samples/client/petstore/eiffel/src/domain/enum_arrays.e +++ b/samples/client/petstore/eiffel/src/domain/enum_arrays.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/enum_class.e b/samples/client/petstore/eiffel/src/domain/enum_class.e index 2b37b2f8ff50..79a0e952b2f4 100644 --- a/samples/client/petstore/eiffel/src/domain/enum_class.e +++ b/samples/client/petstore/eiffel/src/domain/enum_class.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/enum_test.e b/samples/client/petstore/eiffel/src/domain/enum_test.e index 273e2eb89580..87cf363f7015 100644 --- a/samples/client/petstore/eiffel/src/domain/enum_test.e +++ b/samples/client/petstore/eiffel/src/domain/enum_test.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/format_test.e b/samples/client/petstore/eiffel/src/domain/format_test.e index 67df5623e52b..52d9167188f3 100644 --- a/samples/client/petstore/eiffel/src/domain/format_test.e +++ b/samples/client/petstore/eiffel/src/domain/format_test.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -48,9 +48,7 @@ feature --Access uuid: detachable UUID - password: detachable STRING - - big_decimal: detachable BIG_DECIMAL + password: detachable STRING_32 feature -- Change Element @@ -159,14 +157,6 @@ feature -- Change Element password_set: password = a_name end - set_big_decimal (a_name: like big_decimal) - -- Set 'big_decimal' with 'a_name'. - do - big_decimal := a_name - ensure - big_decimal_set: big_decimal = a_name - end - feature -- Status Report @@ -240,11 +230,6 @@ feature -- Change Element Result.append (l_password.out) Result.append ("%N") end - if attached big_decimal as l_big_decimal then - Result.append ("%Nbig_decimal:") - Result.append (l_big_decimal.out) - Result.append ("%N") - end end end diff --git a/samples/client/petstore/eiffel/src/domain/has_only_read_only.e b/samples/client/petstore/eiffel/src/domain/has_only_read_only.e index 80a9b8a78cc5..27cf1ba49d0e 100644 --- a/samples/client/petstore/eiffel/src/domain/has_only_read_only.e +++ b/samples/client/petstore/eiffel/src/domain/has_only_read_only.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/map_test.e b/samples/client/petstore/eiffel/src/domain/map_test.e index 62eb65c6e0c6..0e7cf934f014 100644 --- a/samples/client/petstore/eiffel/src/domain/map_test.e +++ b/samples/client/petstore/eiffel/src/domain/map_test.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,10 +28,6 @@ feature --Access map_of_enum_string: detachable STRING_TABLE[STRING_32] - direct_map: STRING_TABLE[BOOLEAN] - - indirect_map: STRING_TABLE[BOOLEAN] - feature -- Change Element @@ -51,22 +47,6 @@ feature -- Change Element map_of_enum_string_set: map_of_enum_string = a_name end - set_direct_map (a_name: like direct_map) - -- Set 'direct_map' with 'a_name'. - do - direct_map := a_name - ensure - direct_map_set: direct_map = a_name - end - - set_indirect_map (a_name: like indirect_map) - -- Set 'indirect_map' with 'a_name'. - do - indirect_map := a_name - ensure - indirect_map_set: indirect_map = a_name - end - feature -- Status Report @@ -99,30 +79,6 @@ feature -- Change Element Result.append ("%N") end end - if attached direct_map as l_direct_map then - Result.append ("%Ndirect_map:") - across l_direct_map as ic loop - Result.append ("%N") - Result.append ("key:") - Result.append (ic.key.out) - Result.append (" - ") - Result.append ("val:") - Result.append (ic.item.out) - Result.append ("%N") - end - end - if attached indirect_map as l_indirect_map then - Result.append ("%Nindirect_map:") - across l_indirect_map as ic loop - Result.append ("%N") - Result.append ("key:") - Result.append (ic.key.out) - Result.append (" - ") - Result.append ("val:") - Result.append (ic.item.out) - Result.append ("%N") - end - end end end diff --git a/samples/client/petstore/eiffel/src/domain/mixed_properties_and_additional_properties_class.e b/samples/client/petstore/eiffel/src/domain/mixed_properties_and_additional_properties_class.e index 0f0880fc5210..2bb76decc071 100644 --- a/samples/client/petstore/eiffel/src/domain/mixed_properties_and_additional_properties_class.e +++ b/samples/client/petstore/eiffel/src/domain/mixed_properties_and_additional_properties_class.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/model_200_response.e b/samples/client/petstore/eiffel/src/domain/model_200_response.e index 3228375b48d2..a365d406b58e 100644 --- a/samples/client/petstore/eiffel/src/domain/model_200_response.e +++ b/samples/client/petstore/eiffel/src/domain/model_200_response.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/name.e b/samples/client/petstore/eiffel/src/domain/name.e index 7ec27b4217a4..2d1c49cc0635 100644 --- a/samples/client/petstore/eiffel/src/domain/name.e +++ b/samples/client/petstore/eiffel/src/domain/name.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/number_only.e b/samples/client/petstore/eiffel/src/domain/number_only.e index f761185c0cff..270cbcbea3c3 100644 --- a/samples/client/petstore/eiffel/src/domain/number_only.e +++ b/samples/client/petstore/eiffel/src/domain/number_only.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/order.e b/samples/client/petstore/eiffel/src/domain/order.e index b30db500ae5c..0da3b9349f94 100644 --- a/samples/client/petstore/eiffel/src/domain/order.e +++ b/samples/client/petstore/eiffel/src/domain/order.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/outer_composite.e b/samples/client/petstore/eiffel/src/domain/outer_composite.e index 986125f5941b..845476ed1513 100644 --- a/samples/client/petstore/eiffel/src/domain/outer_composite.e +++ b/samples/client/petstore/eiffel/src/domain/outer_composite.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/outer_enum.e b/samples/client/petstore/eiffel/src/domain/outer_enum.e index 6e93a0d41dc3..c88e2c561a0e 100644 --- a/samples/client/petstore/eiffel/src/domain/outer_enum.e +++ b/samples/client/petstore/eiffel/src/domain/outer_enum.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/pet.e b/samples/client/petstore/eiffel/src/domain/pet.e index 71c6620625c4..86d845c22e87 100644 --- a/samples/client/petstore/eiffel/src/domain/pet.e +++ b/samples/client/petstore/eiffel/src/domain/pet.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/read_only_first.e b/samples/client/petstore/eiffel/src/domain/read_only_first.e index 278a836905cc..65d41d07fac4 100644 --- a/samples/client/petstore/eiffel/src/domain/read_only_first.e +++ b/samples/client/petstore/eiffel/src/domain/read_only_first.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/return.e b/samples/client/petstore/eiffel/src/domain/return.e index 063c921c6cd0..2e08c0f53d9f 100644 --- a/samples/client/petstore/eiffel/src/domain/return.e +++ b/samples/client/petstore/eiffel/src/domain/return.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/special_model_name.e b/samples/client/petstore/eiffel/src/domain/special_model_name.e index 15c4b7f45126..90e30e783f20 100644 --- a/samples/client/petstore/eiffel/src/domain/special_model_name.e +++ b/samples/client/petstore/eiffel/src/domain/special_model_name.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/tag.e b/samples/client/petstore/eiffel/src/domain/tag.e index 61bf5592c1c0..f62729bed5d2 100644 --- a/samples/client/petstore/eiffel/src/domain/tag.e +++ b/samples/client/petstore/eiffel/src/domain/tag.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/domain/user.e b/samples/client/petstore/eiffel/src/domain/user.e index 5848fc7ca2bd..07586c1b55d1 100644 --- a/samples/client/petstore/eiffel/src/domain/user.e +++ b/samples/client/petstore/eiffel/src/domain/user.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_client_request.e b/samples/client/petstore/eiffel/src/framework/api_client_request.e index 816e717e611c..fcd2a09d1411 100644 --- a/samples/client/petstore/eiffel/src/framework/api_client_request.e +++ b/samples/client/petstore/eiffel/src/framework/api_client_request.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_client_response.e b/samples/client/petstore/eiffel/src/framework/api_client_response.e index c17c730f541a..cf0978b25797 100644 --- a/samples/client/petstore/eiffel/src/framework/api_client_response.e +++ b/samples/client/petstore/eiffel/src/framework/api_client_response.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_error.e b/samples/client/petstore/eiffel/src/framework/api_error.e index 69871d5261c8..ca89aae7f7a7 100644 --- a/samples/client/petstore/eiffel/src/framework/api_error.e +++ b/samples/client/petstore/eiffel/src/framework/api_error.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/api_i.e b/samples/client/petstore/eiffel/src/framework/api_i.e index 019e0f9c89ee..ca0a45cd41c4 100644 --- a/samples/client/petstore/eiffel/src/framework/api_i.e +++ b/samples/client/petstore/eiffel/src/framework/api_i.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e b/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e index 2bf9a468b0a9..4087386d6013 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/api_key_auth.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/authentication.e b/samples/client/petstore/eiffel/src/framework/auth/authentication.e index 3ce3085eccfa..b53248ae6e3f 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/authentication.e +++ b/samples/client/petstore/eiffel/src/framework/auth/authentication.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e b/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e index 3c26a645cb53..3fd7664bcec1 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/http_basic_auth.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/auth/oauth.e b/samples/client/petstore/eiffel/src/framework/auth/oauth.e index f8898302f87b..66b4ba5c3c5f 100644 --- a/samples/client/petstore/eiffel/src/framework/auth/oauth.e +++ b/samples/client/petstore/eiffel/src/framework/auth/oauth.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/configuration.e b/samples/client/petstore/eiffel/src/framework/configuration.e index 1ede7bf95840..3b9fe5e834e6 100644 --- a/samples/client/petstore/eiffel/src/framework/configuration.e +++ b/samples/client/petstore/eiffel/src/framework/configuration.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e index 8f83f763c740..22f065ace998 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_deserializer.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e index dd5f91d56bfd..993decf6a2c2 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_json_deserializer.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -20,7 +20,7 @@ expanded class feature -- Access from_json (a_val:STRING; a_type: TYPE [detachable ANY] ): detachable ANY - -- Deserialize a json representation `a_val' to an object + -- Deserialize a a json representation `a_val' to an object -- of type `a_type' local conv_from: JSON_BASIC_REFLECTOR_DESERIALIZER diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e index 3bbb064f8f80..b7a144f70181 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_json_serializer.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e b/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e index 46326c768317..db5d96af069b 100644 --- a/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e +++ b/samples/client/petstore/eiffel/src/framework/serialization/api_serializer.e @@ -2,7 +2,7 @@ note description:"[ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/eiffel/test/api_test.ecf b/samples/client/petstore/eiffel/test/api_test.ecf index 0c5a53eed83d..ddb5082cabec 100644 --- a/samples/client/petstore/eiffel/test/api_test.ecf +++ b/samples/client/petstore/eiffel/test/api_test.ecf @@ -1,5 +1,5 @@ - + diff --git a/samples/client/petstore/erlang-client/.openapi-generator/VERSION b/samples/client/petstore/erlang-client/.openapi-generator/VERSION index bfbf77eb7fad..105bb87d77b3 100644 --- a/samples/client/petstore/erlang-client/.openapi-generator/VERSION +++ b/samples/client/petstore/erlang-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-client/src/petstore_pet_api.erl b/samples/client/petstore/erlang-client/src/petstore_pet_api.erl index d46e57785f3a..bbb664f66bda 100644 --- a/samples/client/petstore/erlang-client/src/petstore_pet_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_pet_api.erl @@ -14,11 +14,11 @@ %% @doc Add a new pet to the store %% -spec add_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -add_pet(Ctx, Body) -> - add_pet(Ctx, Body, #{}). +add_pet(Ctx, PetstorePet) -> + add_pet(Ctx, PetstorePet, #{}). -spec add_pet(ctx:ctx(), petstore_pet:petstore_pet(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -add_pet(Ctx, Body, Optional) -> +add_pet(Ctx, PetstorePet, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -26,7 +26,7 @@ add_pet(Ctx, Body, Optional) -> Path = ["/pet"], QS = [], Headers = [], - Body1 = Body, + Body1 = PetstorePet, ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>, <<"application/xml">>]), Opts = maps:get(hackney_opts, Optional, []), @@ -119,11 +119,11 @@ get_pet_by_id(Ctx, PetId, Optional) -> %% @doc Update an existing pet %% -spec update_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -update_pet(Ctx, Body) -> - update_pet(Ctx, Body, #{}). +update_pet(Ctx, PetstorePet) -> + update_pet(Ctx, PetstorePet, #{}). -spec update_pet(ctx:ctx(), petstore_pet:petstore_pet(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -update_pet(Ctx, Body, Optional) -> +update_pet(Ctx, PetstorePet, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -131,7 +131,7 @@ update_pet(Ctx, Body, Optional) -> Path = ["/pet"], QS = [], Headers = [], - Body1 = Body, + Body1 = PetstorePet, ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>, <<"application/xml">>]), Opts = maps:get(hackney_opts, Optional, []), diff --git a/samples/client/petstore/erlang-client/src/petstore_store_api.erl b/samples/client/petstore/erlang-client/src/petstore_store_api.erl index cf579f116457..178cd0a2cb23 100644 --- a/samples/client/petstore/erlang-client/src/petstore_store_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_store_api.erl @@ -73,11 +73,11 @@ get_order_by_id(Ctx, OrderId, Optional) -> %% @doc Place an order for a pet %% -spec place_order(ctx:ctx(), petstore_order:petstore_order()) -> {ok, petstore_order:petstore_order(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -place_order(Ctx, Body) -> - place_order(Ctx, Body, #{}). +place_order(Ctx, PetstoreOrder) -> + place_order(Ctx, PetstoreOrder, #{}). -spec place_order(ctx:ctx(), petstore_order:petstore_order(), maps:map()) -> {ok, petstore_order:petstore_order(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -place_order(Ctx, Body, Optional) -> +place_order(Ctx, PetstoreOrder, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -85,7 +85,7 @@ place_order(Ctx, Body, Optional) -> Path = ["/store/order"], QS = [], Headers = [], - Body1 = Body, + Body1 = PetstoreOrder, ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), diff --git a/samples/client/petstore/erlang-client/src/petstore_user_api.erl b/samples/client/petstore/erlang-client/src/petstore_user_api.erl index dd44acddd965..b1f07026be88 100644 --- a/samples/client/petstore/erlang-client/src/petstore_user_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_user_api.erl @@ -14,11 +14,11 @@ %% @doc Create user %% This can only be done by the logged in user. -spec create_user(ctx:ctx(), petstore_user:petstore_user()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -create_user(Ctx, Body) -> - create_user(Ctx, Body, #{}). +create_user(Ctx, PetstoreUser) -> + create_user(Ctx, PetstoreUser, #{}). -spec create_user(ctx:ctx(), petstore_user:petstore_user(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -create_user(Ctx, Body, Optional) -> +create_user(Ctx, PetstoreUser, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -26,7 +26,7 @@ create_user(Ctx, Body, Optional) -> Path = ["/user"], QS = [], Headers = [], - Body1 = Body, + Body1 = PetstoreUser, ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), @@ -35,11 +35,11 @@ create_user(Ctx, Body, Optional) -> %% @doc Creates list of users with given input array %% -spec create_users_with_array_input(ctx:ctx(), list()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -create_users_with_array_input(Ctx, Body) -> - create_users_with_array_input(Ctx, Body, #{}). +create_users_with_array_input(Ctx, PetstoreUserArray) -> + create_users_with_array_input(Ctx, PetstoreUserArray, #{}). -spec create_users_with_array_input(ctx:ctx(), list(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -create_users_with_array_input(Ctx, Body, Optional) -> +create_users_with_array_input(Ctx, PetstoreUserArray, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -47,7 +47,7 @@ create_users_with_array_input(Ctx, Body, Optional) -> Path = ["/user/createWithArray"], QS = [], Headers = [], - Body1 = Body, + Body1 = PetstoreUserArray, ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), @@ -56,11 +56,11 @@ create_users_with_array_input(Ctx, Body, Optional) -> %% @doc Creates list of users with given input array %% -spec create_users_with_list_input(ctx:ctx(), list()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -create_users_with_list_input(Ctx, Body) -> - create_users_with_list_input(Ctx, Body, #{}). +create_users_with_list_input(Ctx, PetstoreUserArray) -> + create_users_with_list_input(Ctx, PetstoreUserArray, #{}). -spec create_users_with_list_input(ctx:ctx(), list(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -create_users_with_list_input(Ctx, Body, Optional) -> +create_users_with_list_input(Ctx, PetstoreUserArray, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -68,7 +68,7 @@ create_users_with_list_input(Ctx, Body, Optional) -> Path = ["/user/createWithList"], QS = [], Headers = [], - Body1 = Body, + Body1 = PetstoreUserArray, ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), @@ -161,11 +161,11 @@ logout_user(Ctx, Optional) -> %% @doc Updated user %% This can only be done by the logged in user. -spec update_user(ctx:ctx(), binary(), petstore_user:petstore_user()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -update_user(Ctx, Username, Body) -> - update_user(Ctx, Username, Body, #{}). +update_user(Ctx, Username, PetstoreUser) -> + update_user(Ctx, Username, PetstoreUser, #{}). -spec update_user(ctx:ctx(), binary(), petstore_user:petstore_user(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. -update_user(Ctx, Username, Body, Optional) -> +update_user(Ctx, Username, PetstoreUser, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -173,7 +173,7 @@ update_user(Ctx, Username, Body, Optional) -> Path = ["/user/", Username, ""], QS = [], Headers = [], - Body1 = Body, + Body1 = PetstoreUser, ContentTypeHeader = petstore_utils:select_header_content_type([]), Opts = maps:get(hackney_opts, Optional, []), diff --git a/samples/client/petstore/erlang-proper/.openapi-generator/VERSION b/samples/client/petstore/erlang-proper/.openapi-generator/VERSION index bfbf77eb7fad..a65271290834 100644 --- a/samples/client/petstore/erlang-proper/.openapi-generator/VERSION +++ b/samples/client/petstore/erlang-proper/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-proper/src/petstore_api.erl b/samples/client/petstore/erlang-proper/src/petstore_api.erl index faf58355ab07..2f852cfd4073 100644 --- a/samples/client/petstore/erlang-proper/src/petstore_api.erl +++ b/samples/client/petstore/erlang-proper/src/petstore_api.erl @@ -16,11 +16,11 @@ %% This can only be done by the logged in user. -spec create_user(petstore_user:petstore_user()) -> petstore_utils:response(). -create_user(Body) -> +create_user(PetstoreUser) -> Method = post, Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user"], - Body = Body, + Body = PetstoreUser, ContentType = "text/plain", petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). @@ -29,11 +29,11 @@ create_user(Body) -> %% -spec create_users_with_array_input(list(petstore_user:petstore_user())) -> petstore_utils:response(). -create_users_with_array_input(Body) -> +create_users_with_array_input(PetstoreUserArray) -> Method = post, Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user/createWithArray"], - Body = Body, + Body = PetstoreUserArray, ContentType = "text/plain", petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). @@ -42,11 +42,11 @@ create_users_with_array_input(Body) -> %% -spec create_users_with_list_input(list(petstore_user:petstore_user())) -> petstore_utils:response(). -create_users_with_list_input(Body) -> +create_users_with_list_input(PetstoreUserArray) -> Method = post, Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user/createWithList"], - Body = Body, + Body = PetstoreUserArray, ContentType = "text/plain", petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). @@ -100,11 +100,11 @@ logout_user() -> %% This can only be done by the logged in user. -spec update_user(binary(), petstore_user:petstore_user()) -> petstore_utils:response(). -update_user(Username, Body) -> +update_user(Username, PetstoreUser) -> Method = put, Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user/", Username, ""], - Body = Body, + Body = PetstoreUser, ContentType = "text/plain", petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). diff --git a/samples/client/petstore/erlang-proper/src/petstore_statem.erl b/samples/client/petstore/erlang-proper/src/petstore_statem.erl index cb6f3031e878..9244c6fbf0c0 100644 --- a/samples/client/petstore/erlang-proper/src/petstore_statem.erl +++ b/samples/client/petstore/erlang-proper/src/petstore_statem.erl @@ -61,8 +61,8 @@ initial_state() -> #{}. %% create_user %%============================================================================== -create_user(Body) -> - petstore_api:create_user(Body). +create_user(PetstoreUser) -> + petstore_api:create_user(PetstoreUser). create_user_args(_S) -> [petstore_user:petstore_user()]. @@ -71,8 +71,8 @@ create_user_args(_S) -> %% create_users_with_array_input %%============================================================================== -create_users_with_array_input(Body) -> - petstore_api:create_users_with_array_input(Body). +create_users_with_array_input(PetstoreUserArray) -> + petstore_api:create_users_with_array_input(PetstoreUserArray). create_users_with_array_input_args(_S) -> [list(petstore_user:petstore_user())]. @@ -81,8 +81,8 @@ create_users_with_array_input_args(_S) -> %% create_users_with_list_input %%============================================================================== -create_users_with_list_input(Body) -> - petstore_api:create_users_with_list_input(Body). +create_users_with_list_input(PetstoreUserArray) -> + petstore_api:create_users_with_list_input(PetstoreUserArray). create_users_with_list_input_args(_S) -> [list(petstore_user:petstore_user())]. @@ -131,8 +131,8 @@ logout_user_args(_S) -> %% update_user %%============================================================================== -update_user(Username, Body) -> - petstore_api:update_user(Username, Body). +update_user(Username, PetstoreUser) -> + petstore_api:update_user(Username, PetstoreUser). update_user_args(_S) -> [binary(), petstore_user:petstore_user()]. diff --git a/samples/client/petstore/flash/.openapi-generator/VERSION b/samples/client/petstore/flash/.openapi-generator/VERSION index bfbf77eb7fad..096bf47efe31 100644 --- a/samples/client/petstore/flash/.openapi-generator/VERSION +++ b/samples/client/petstore/flash/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/flash/flash/build.xml b/samples/client/petstore/flash/flash/build.xml index dedf7e030081..da3c67f83443 100644 --- a/samples/client/petstore/flash/flash/build.xml +++ b/samples/client/petstore/flash/flash/build.xml @@ -15,7 +15,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -189,4 +189,4 @@ - + \ No newline at end of file diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as index 4f6f089ddacc..3ad9c7c96dc1 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/PetApi.as @@ -38,7 +38,7 @@ public class PetApi extends OpenApi { /* * Returns void */ - public function add_pet (body: Pet): String { + public function add_pet (pet: Pet): String { // create path and map variables var path: String = "/pet".replace(/{format}/g,"xml"); @@ -53,7 +53,7 @@ public class PetApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, pet, headerParams); var requestId: String = getUniqueId(); @@ -197,7 +197,7 @@ public class PetApi extends OpenApi { /* * Returns void */ - public function update_pet (body: Pet): String { + public function update_pet (pet: Pet): String { // create path and map variables var path: String = "/pet".replace(/{format}/g,"xml"); @@ -212,7 +212,7 @@ public class PetApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, pet, headerParams); var requestId: String = getUniqueId(); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as index 1fd7d4ec419c..d013f1a82d19 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/StoreApi.as @@ -118,7 +118,7 @@ public class StoreApi extends OpenApi { /* * Returns Order */ - public function place_order (body: Order): String { + public function place_order (order: Order): String { // create path and map variables var path: String = "/store/order".replace(/{format}/g,"xml"); @@ -133,7 +133,7 @@ public class StoreApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, order, headerParams); var requestId: String = getUniqueId(); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as index 936598c929dc..3f11ff6e7bda 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/client/api/UserApi.as @@ -36,7 +36,7 @@ public class UserApi extends OpenApi { /* * Returns void */ - public function create_user (body: User): String { + public function create_user (user: User): String { // create path and map variables var path: String = "/user".replace(/{format}/g,"xml"); @@ -51,7 +51,7 @@ public class UserApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, user, headerParams); var requestId: String = getUniqueId(); @@ -66,7 +66,7 @@ public class UserApi extends OpenApi { /* * Returns void */ - public function create_users_with_array_input (body: Array): String { + public function create_users_with_array_input (user: Array): String { // create path and map variables var path: String = "/user/createWithArray".replace(/{format}/g,"xml"); @@ -81,7 +81,7 @@ public class UserApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, user, headerParams); var requestId: String = getUniqueId(); @@ -96,7 +96,7 @@ public class UserApi extends OpenApi { /* * Returns void */ - public function create_users_with_list_input (body: Array): String { + public function create_users_with_list_input (user: Array): String { // create path and map variables var path: String = "/user/createWithList".replace(/{format}/g,"xml"); @@ -111,7 +111,7 @@ public class UserApi extends OpenApi { - var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "POST", queryParams, user, headerParams); var requestId: String = getUniqueId(); @@ -250,7 +250,7 @@ if("null" != String(password)) /* * Returns void */ - public function update_user (username: String, body: User): String { + public function update_user (username: String, user: User): String { // create path and map variables var path: String = "/user/{username}".replace(/{format}/g,"xml").replace("{" + "username" + "}", getApiInvoker().escapeString(username)); @@ -269,7 +269,7 @@ if("null" != String(password)) - var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, body, headerParams); + var token:AsyncToken = getApiInvoker().invokeAPI(path, "PUT", queryParams, user, headerParams); var requestId: String = getUniqueId(); diff --git a/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as b/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as index abb0fe121fb2..964dbc26d692 100644 --- a/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as +++ b/samples/client/petstore/flash/flash/src/org/openapitools/event/ApiClientEvent.as @@ -11,7 +11,7 @@ import flash.events.Event; public class ApiClientEvent extends Event{ /** - * Event type to indicate an unsuccessful invocation + * Event type to indicate a unsuccessful invocation */ public static const FAILURE_EVENT:String = "unsuccesfulInvocation"; @@ -33,4 +33,4 @@ public class ApiClientEvent extends Event{ super(type, bubbles, cancelable); } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/flash/git_push.sh b/samples/client/petstore/flash/git_push.sh index ced3be2b0c7b..8442b80bb445 100644 --- a/samples/client/petstore/flash/git_push.sh +++ b/samples/client/petstore/flash/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -34,7 +28,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_fake.go index 55c51d6c3311..6a39cfa04ce1 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake.go @@ -1755,7 +1755,7 @@ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Respo localVarQueryParams.Add("pipe", parameterToString(*r.pipe, "csv")) localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(*r.http, "ssv")) + localVarQueryParams.Add("http", parameterToString(*r.http, "space")) localVarQueryParams.Add("url", parameterToString(*r.url, "csv")) { t := *r.context 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 903c2cd278a9..bad36447bd8e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -1215,7 +1215,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "ssv")) + localVarQueryParams.Add("http", parameterToString(http, "space")) localVarQueryParams.Add("url", parameterToString(url, "csv")) { t:=context diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 95cbc096ab1e..61f9d2ed9ec5 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -1214,7 +1214,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "ssv")) + localVarQueryParams.Add("http", parameterToString(http, "space")) localVarQueryParams.Add("url", parameterToString(url, "csv")) { t:=context diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java index ad88302f204b..71dfcd555569 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java @@ -407,7 +407,7 @@ public TestQueryParameterCollectionFormatQueryParams ioutil(final List v return this; } public TestQueryParameterCollectionFormatQueryParams http(final List value) { - put("http", EncodingUtils.encodeCollection(value, "ssv")); + put("http", EncodingUtils.encodeCollection(value, "space")); return this; } public TestQueryParameterCollectionFormatQueryParams url(final List value) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java index ad88302f204b..71dfcd555569 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java @@ -407,7 +407,7 @@ public TestQueryParameterCollectionFormatQueryParams ioutil(final List v return this; } public TestQueryParameterCollectionFormatQueryParams http(final List value) { - put("http", EncodingUtils.encodeCollection(value, "ssv")); + put("http", EncodingUtils.encodeCollection(value, "space")); return this; } public TestQueryParameterCollectionFormatQueryParams url(final List value) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java index 3c3ca7c4c9c9..ea1d42bae884 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java @@ -760,7 +760,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java index 506535e1d33e..6410a95d1731 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1149,7 +1149,7 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List testQueryParameterCollectionFormatWithHttpInfo(List testQueryParameterCollectionFormatWithHttpInfo(List pipe, List i List localVarQueryParams = new ArrayList<>(); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(ApiClient.parameterToPairs("ssv", "http", http)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("space", "http", http)); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 657e2dfd968b..121867dd07a9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1791,7 +1791,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } if (http != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http)); + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 657e2dfd968b..121867dd07a9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1791,7 +1791,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } if (http != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http)); + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java index bd2b2386f2bc..34b1bf258781 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java @@ -732,7 +732,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java index 2c5be6cd0ecb..16ef84563250 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java @@ -852,7 +852,7 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java index 2c5be6cd0ecb..16ef84563250 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java @@ -852,7 +852,7 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java index 1bfe577e26ca..1ce6dc060c27 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java @@ -408,7 +408,7 @@ void testJsonFormData( @PUT("/fake/test-query-paramters") Void testQueryParameterCollectionFormat( - @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SSVParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context ); /** @@ -424,6 +424,6 @@ Void testQueryParameterCollectionFormat( @PUT("/fake/test-query-paramters") void testQueryParameterCollectionFormat( - @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SSVParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context, Callback cb + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java index b1a773c63d71..0c05259fb1e8 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ F.Promise> testJsonFormData( */ @PUT("fake/test-query-paramters") F.Promise> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java index a9c8e3f16da0..f8a5c1f9ec2f 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ CompletionStage> testJsonFormData( */ @PUT("fake/test-query-paramters") CompletionStage> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java index a9c8e3f16da0..f8a5c1f9ec2f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ CompletionStage> testJsonFormData( */ @PUT("fake/test-query-paramters") CompletionStage> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java index dbaa2f6d1b76..d536945d5d43 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -225,7 +225,7 @@ Call testJsonFormData( */ @PUT("fake/test-query-paramters") Call testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java index 438c244adc70..b17c3d20f2b4 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -225,7 +225,7 @@ Observable testJsonFormData( */ @PUT("fake/test-query-paramters") Observable testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java index a2d7e57449e9..82a7657309f2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -226,7 +226,7 @@ Completable testJsonFormData( */ @PUT("fake/test-query-paramters") Completable testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java index 70b3577d960b..e32629442fd5 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -650,7 +650,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i List localVarQueryParams = new ArrayList<>(); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index 46aded06d3f6..186f35269cd7 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -626,7 +626,7 @@ public Mono testQueryParameterCollectionFormat(List pipe, List} tags Tags to filter by + * @param {!number=} opt_maxCount Maximum number of items to return * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise>} */ -API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequestParams) { +API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_maxCount, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/pet/findByTags'; @@ -185,6 +186,10 @@ API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequest queryParameters['tags'] = tags; } + if (opt_maxCount !== undefined) { + queryParameters['maxCount'] = opt_maxCount; + } + /** @type {!Object} */ var httpRequestParams = { method: 'GET', @@ -241,11 +246,11 @@ API.Client.PetApi.prototype.getPetById = function(petId, opt_extraHttpRequestPar /** * Update an existing pet * - * @param {!Pet} body Pet object that needs to be added to the store + * @param {!Pet} pet Pet object that needs to be added to the store * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.PetApi.prototype.updatePet = function(body, opt_extraHttpRequestParams) { +API.Client.PetApi.prototype.updatePet = function(pet, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/pet'; @@ -254,16 +259,16 @@ API.Client.PetApi.prototype.updatePet = function(body, opt_extraHttpRequestParam /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling updatePet'); + // verify required parameter 'pet' is set + if (!pet) { + throw new Error('Missing required parameter pet when calling updatePet'); } /** @type {!Object} */ var httpRequestParams = { method: 'PUT', url: path, json: true, - data: body, + data: pet, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js b/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js index f26328cb7c31..6df64168d26f 100644 --- a/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js +++ b/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js @@ -151,11 +151,11 @@ API.Client.StoreApi.prototype.getOrderById = function(orderId, opt_extraHttpRequ /** * Place an order for a pet * - * @param {!Order} body order placed for purchasing the pet + * @param {!Order} order order placed for purchasing the pet * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.StoreApi.prototype.placeOrder = function(body, opt_extraHttpRequestParams) { +API.Client.StoreApi.prototype.placeOrder = function(order, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/store/order'; @@ -164,16 +164,16 @@ API.Client.StoreApi.prototype.placeOrder = function(body, opt_extraHttpRequestPa /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling placeOrder'); + // verify required parameter 'order' is set + if (!order) { + throw new Error('Missing required parameter order when calling placeOrder'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: body, + data: order, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js b/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js index a5e5610f9a94..1b8b3fc744b7 100644 --- a/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js +++ b/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js @@ -46,11 +46,11 @@ API.Client.UserApi.$inject = ['$http', '$httpParamSerializer', '$injector']; /** * Create user * This can only be done by the logged in user. - * @param {!User} body Created user object + * @param {!User} user Created user object * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.UserApi.prototype.createUser = function(body, opt_extraHttpRequestParams) { +API.Client.UserApi.prototype.createUser = function(user, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/user'; @@ -59,16 +59,16 @@ API.Client.UserApi.prototype.createUser = function(body, opt_extraHttpRequestPar /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling createUser'); + // verify required parameter 'user' is set + if (!user) { + throw new Error('Missing required parameter user when calling createUser'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: body, + data: user, params: queryParameters, headers: headerParams }; @@ -83,11 +83,11 @@ API.Client.UserApi.prototype.createUser = function(body, opt_extraHttpRequestPar /** * Creates list of users with given input array * - * @param {!Array} body List of user object + * @param {!Array} user List of user object * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.UserApi.prototype.createUsersWithArrayInput = function(body, opt_extraHttpRequestParams) { +API.Client.UserApi.prototype.createUsersWithArrayInput = function(user, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/user/createWithArray'; @@ -96,16 +96,16 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(body, opt_extr /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling createUsersWithArrayInput'); + // verify required parameter 'user' is set + if (!user) { + throw new Error('Missing required parameter user when calling createUsersWithArrayInput'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: body, + data: user, params: queryParameters, headers: headerParams }; @@ -120,11 +120,11 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(body, opt_extr /** * Creates list of users with given input array * - * @param {!Array} body List of user object + * @param {!Array} user List of user object * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.UserApi.prototype.createUsersWithListInput = function(body, opt_extraHttpRequestParams) { +API.Client.UserApi.prototype.createUsersWithListInput = function(user, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/user/createWithList'; @@ -133,16 +133,16 @@ API.Client.UserApi.prototype.createUsersWithListInput = function(body, opt_extra /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling createUsersWithListInput'); + // verify required parameter 'user' is set + if (!user) { + throw new Error('Missing required parameter user when calling createUsersWithListInput'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: body, + data: user, params: queryParameters, headers: headerParams }; @@ -312,11 +312,11 @@ API.Client.UserApi.prototype.logoutUser = function(opt_extraHttpRequestParams) { * Updated user * This can only be done by the logged in user. * @param {!string} username name that need to be deleted - * @param {!User} body Updated user object + * @param {!User} user Updated user object * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.UserApi.prototype.updateUser = function(username, body, opt_extraHttpRequestParams) { +API.Client.UserApi.prototype.updateUser = function(username, user, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/user/{username}' .replace('{' + 'username' + '}', String(username)); @@ -330,16 +330,16 @@ API.Client.UserApi.prototype.updateUser = function(username, body, opt_extraHttp if (!username) { throw new Error('Missing required parameter username when calling updateUser'); } - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling updateUser'); + // verify required parameter 'user' is set + if (!user) { + throw new Error('Missing required parameter user when calling updateUser'); } /** @type {!Object} */ var httpRequestParams = { method: 'PUT', url: path, json: true, - data: body, + data: user, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index 316e9bd88182..8c3bffd8c857 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -692,7 +692,7 @@ export default class FakeApi { let queryParams = { 'pipe': this.apiClient.buildCollectionParam(pipe, 'csv'), 'ioutil': this.apiClient.buildCollectionParam(ioutil, 'csv'), - 'http': this.apiClient.buildCollectionParam(http, 'ssv'), + 'http': this.apiClient.buildCollectionParam(http, 'space'), 'url': this.apiClient.buildCollectionParam(url, 'csv'), 'context': this.apiClient.buildCollectionParam(context, 'multi') }; diff --git a/samples/client/petstore/javascript-flowtyped/.babelrc b/samples/client/petstore/javascript-flowtyped/.babelrc index 49f99e74b524..4bf17b5e66ec 100644 --- a/samples/client/petstore/javascript-flowtyped/.babelrc +++ b/samples/client/petstore/javascript-flowtyped/.babelrc @@ -1,6 +1,6 @@ { "presets": [ - ["react-app", { "absoluteRuntime": false }], + "react-app", "@babel/preset-flow" ], "plugins": [ diff --git a/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION b/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION index bfbf77eb7fad..83a328a9227e 100644 --- a/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-flowtyped/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index 106c7ec20783..8c041077a12e 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -783,7 +783,7 @@ export default class FakeApi { let queryParams = { 'pipe': this.apiClient.buildCollectionParam(pipe, 'csv'), 'ioutil': this.apiClient.buildCollectionParam(ioutil, 'csv'), - 'http': this.apiClient.buildCollectionParam(http, 'ssv'), + 'http': this.apiClient.buildCollectionParam(http, 'space'), 'url': this.apiClient.buildCollectionParam(url, 'csv'), 'context': this.apiClient.buildCollectionParam(context, 'multi') }; diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index 65a657500484..ed05ed8ee50c 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -831,7 +831,7 @@ }, 'http': { value: http, - collectionFormat: 'ssv' + collectionFormat: 'space' }, 'url': { value: url, diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index 3e132ea7d7bd..7537c4189a20 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -740,7 +740,7 @@ }, 'http': { value: http, - collectionFormat: 'ssv' + collectionFormat: 'space' }, 'url': { value: url, diff --git a/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION b/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION index bfbf77eb7fad..afa636560641 100644 --- a/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION +++ b/samples/client/petstore/jaxrs-cxf-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java index 85036661f993..660962be0e43 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Order.java @@ -53,13 +53,13 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String value) { + public static StatusEnum fromValue(String v) { for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } diff --git a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java index ee8a2e071630..0ba245486396 100644 --- a/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/jaxrs-cxf-client/src/gen/java/org/openapitools/model/Pet.java @@ -26,7 +26,7 @@ public class Pet { private Long id; @ApiModelProperty(value = "") - private Category category; + private Category category = null; @ApiModelProperty(example = "doggie", required = true, value = "") private String name; @@ -59,13 +59,13 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String value) { + public static StatusEnum fromValue(String v) { for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } diff --git a/samples/client/petstore/jmeter/.openapi-generator/VERSION b/samples/client/petstore/jmeter/.openapi-generator/VERSION index bfbf77eb7fad..82602aa4190d 100644 --- a/samples/client/petstore/jmeter/.openapi-generator/VERSION +++ b/samples/client/petstore/jmeter/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jmeter/PetApi.csv b/samples/client/petstore/jmeter/PetApi.csv index 29b09a1715de..2ab795b50f75 100644 --- a/samples/client/petstore/jmeter/PetApi.csv +++ b/samples/client/petstore/jmeter/PetApi.csv @@ -1,2 +1,2 @@ -testCase,httpStatusCode,body,petId,apiKey,status,tags,petId,body,petId,name,status,petId,additionalMetadata,file +testCase,httpStatusCode,pet,petId,apiKey,status,tags,petId,pet,petId,name,status,petId,additionalMetadata,file Success,200,0,0,0,0,0,0,0,0,0,0,0,0,0 \ No newline at end of file diff --git a/samples/client/petstore/jmeter/StoreApi.csv b/samples/client/petstore/jmeter/StoreApi.csv index 70fd54e2b204..2ccf8884aff0 100644 --- a/samples/client/petstore/jmeter/StoreApi.csv +++ b/samples/client/petstore/jmeter/StoreApi.csv @@ -1,2 +1,2 @@ -testCase,httpStatusCode,orderId,orderId,body +testCase,httpStatusCode,orderId,orderId,order Success,200,0,0,0 \ No newline at end of file diff --git a/samples/client/petstore/jmeter/UserApi.csv b/samples/client/petstore/jmeter/UserApi.csv index 92242d4077c7..66fcc84a5901 100644 --- a/samples/client/petstore/jmeter/UserApi.csv +++ b/samples/client/petstore/jmeter/UserApi.csv @@ -1,2 +1,2 @@ -testCase,httpStatusCode,body,body,body,username,username,username,password,username,body +testCase,httpStatusCode,user,user,user,username,username,username,password,username,user Success,200,0,0,0,0,0,0,0,0,0 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/build.gradle b/samples/client/petstore/kotlin-uppercase-enum/build.gradle index 56be0bd0dd87..ed72aa19d9ef 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/build.gradle +++ b/samples/client/petstore/kotlin-uppercase-enum/build.gradle @@ -10,7 +10,7 @@ buildscript { ext.kotlin_version = '1.3.61' repositories { - maven { url "https://repo1.maven.org/maven2" } + mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -20,7 +20,7 @@ buildscript { apply plugin: 'kotlin' repositories { - maven { url "https://repo1.maven.org/maven2" } + mavenCentral() } test { diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt index ef1dc34d0386..8ed4de2768fe 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt @@ -58,11 +58,11 @@ class EnumApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + throw ClientException(localVarError.body as? String ?: "Client error", localVarError.statusCode) } ResponseType.ServerError -> { val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + throw ServerException(localVarError.message ?: "Server error", localVarError.statusCode) } } } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 76490dd26cea..d1d58ffd0e96 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -10,16 +10,7 @@ import okhttp3.HttpUrl.Companion.toHttpUrlOrNull import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime open class ApiClient(val baseUrl: String) { companion object { @@ -46,55 +37,17 @@ open class ApiClient(val baseUrl: String) { val builder: OkHttpClient.Builder = OkHttpClient.Builder() } - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = when { content is File -> content.asRequestBody( mediaType.toMediaTypeOrNull() ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { + mediaType == FormDataMediaType || mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) + (content as Map).forEach { (key, value) -> + add(key, value) } }.build() } @@ -186,13 +139,12 @@ open class ApiClient(val baseUrl: String) { response.headers.toMultimap() ) response.isClientError -> return ClientError( - response.message, response.body?.string(), response.code, response.headers.toMultimap() ) else -> return ServerError( - response.message, + null, response.body?.string(), response.code, response.headers.toMultimap() @@ -200,33 +152,7 @@ open class ApiClient(val baseUrl: String) { } } - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") + return value.toString() } } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt index 9dc8d8dbbfaa..f1a8aecc914b 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt @@ -4,9 +4,7 @@ enum class ResponseType { Success, Informational, Redirection, ClientError, ServerError } -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +abstract class ApiInfrastructureResponse(val responseType: ResponseType) { abstract val statusCode: Int abstract val headers: Map> } @@ -29,7 +27,6 @@ class Redirection( ) : ApiInfrastructureResponse(ResponseType.Redirection) class ClientError( - val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt index b5310e71f13c..41f529a5f36b 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -3,14 +3,14 @@ package org.openapitools.client.infrastructure import java.lang.RuntimeException -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { +open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) { companion object { private const val serialVersionUID: Long = 123L } } -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { +open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1) : RuntimeException(message) { companion object { private const val serialVersionUID: Long = 456L diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/models/PetEnum.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/models/PetEnum.kt index 1d31ee94c35c..14d9c16c408b 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/models/PetEnum.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/models/PetEnum.kt @@ -19,7 +19,6 @@ import com.squareup.moshi.Json * Values: MY_FIRST_VALUE,MY_SECOND_VALUE */ - enum class PetEnum(val value: kotlin.String){ @@ -32,13 +31,5 @@ enum class PetEnum(val value: kotlin.String){ - /** - This override toString avoids using the enum var name and uses the actual api value instead. - In cases the var name and value are different, the client would send incorrect enums to the server. - **/ - override fun toString(): String { - return value - } - } diff --git a/samples/client/petstore/lua/.openapi-generator/VERSION b/samples/client/petstore/lua/.openapi-generator/VERSION index bfbf77eb7fad..2c6109e5bb82 100644 --- a/samples/client/petstore/lua/.openapi-generator/VERSION +++ b/samples/client/petstore/lua/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.4 \ No newline at end of file diff --git a/samples/client/petstore/lua/git_push.sh b/samples/client/petstore/lua/git_push.sh index ced3be2b0c7b..20057f67ade4 100644 --- a/samples/client/petstore/lua/git_push.sh +++ b/samples/client/petstore/lua/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/lua/petstore/api/pet_api.lua b/samples/client/petstore/lua/petstore/api/pet_api.lua index b480504a9282..d9ce3e8df7fd 100644 --- a/samples/client/petstore/lua/petstore/api/pet_api.lua +++ b/samples/client/petstore/lua/petstore/api/pet_api.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech ]] @@ -45,7 +45,7 @@ local function new_pet_api(authority, basePath, schemes) }, pet_api_mt) end -function pet_api:add_pet(body) +function pet_api:add_pet(pet) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -60,7 +60,7 @@ function pet_api:add_pet(body) --local var_content_type = { "application/json", "application/xml" } req.headers:upsert("accept", "application/json") - req:set_body(dkjson.encode(body)) + req:set_body(dkjson.encode(pet)) -- oAuth if self.access_token then @@ -280,7 +280,7 @@ function pet_api:get_pet_by_id(pet_id) end end -function pet_api:update_pet(body) +function pet_api:update_pet(pet) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -295,7 +295,7 @@ function pet_api:update_pet(body) --local var_content_type = { "application/json", "application/xml" } req.headers:upsert("accept", "application/json") - req:set_body(dkjson.encode(body)) + req:set_body(dkjson.encode(pet)) -- oAuth if self.access_token then diff --git a/samples/client/petstore/lua/petstore/api/store_api.lua b/samples/client/petstore/lua/petstore/api/store_api.lua index 7ca504f484a1..456a1bb6018b 100644 --- a/samples/client/petstore/lua/petstore/api/store_api.lua +++ b/samples/client/petstore/lua/petstore/api/store_api.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech ]] @@ -171,7 +171,7 @@ function store_api:get_order_by_id(order_id) end end -function store_api:place_order(body) +function store_api:place_order(order) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -186,7 +186,7 @@ function store_api:place_order(body) --local var_accept = { "application/xml", "application/json" } req.headers:upsert("content-type", "application/xml") - req:set_body(dkjson.encode(body)) + req:set_body(dkjson.encode(order)) -- make the HTTP call diff --git a/samples/client/petstore/lua/petstore/api/user_api.lua b/samples/client/petstore/lua/petstore/api/user_api.lua index 91e7778c8978..6cc3f251976c 100644 --- a/samples/client/petstore/lua/petstore/api/user_api.lua +++ b/samples/client/petstore/lua/petstore/api/user_api.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech ]] @@ -44,7 +44,7 @@ local function new_user_api(authority, basePath, schemes) }, user_api_mt) end -function user_api:create_user(body) +function user_api:create_user(user) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -55,7 +55,7 @@ function user_api:create_user(body) -- set HTTP verb req.headers:upsert(":method", "POST") - req:set_body(dkjson.encode(body)) + req:set_body(dkjson.encode(user)) -- make the HTTP call @@ -77,7 +77,7 @@ function user_api:create_user(body) end end -function user_api:create_users_with_array_input(body) +function user_api:create_users_with_array_input(user) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -88,7 +88,7 @@ function user_api:create_users_with_array_input(body) -- set HTTP verb req.headers:upsert(":method", "POST") - req:set_body(dkjson.encode(body)) + req:set_body(dkjson.encode(user)) -- make the HTTP call @@ -110,7 +110,7 @@ function user_api:create_users_with_array_input(body) end end -function user_api:create_users_with_list_input(body) +function user_api:create_users_with_list_input(user) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -121,7 +121,7 @@ function user_api:create_users_with_list_input(body) -- set HTTP verb req.headers:upsert(":method", "POST") - req:set_body(dkjson.encode(body)) + req:set_body(dkjson.encode(user)) -- make the HTTP call @@ -297,7 +297,7 @@ function user_api:logout_user() end end -function user_api:update_user(username, body) +function user_api:update_user(username, user) local req = http_request.new_from_uri({ scheme = self.default_scheme; host = self.host; @@ -308,7 +308,7 @@ function user_api:update_user(username, body) -- set HTTP verb req.headers:upsert(":method", "PUT") - req:set_body(dkjson.encode(body)) + req:set_body(dkjson.encode(user)) -- make the HTTP call diff --git a/samples/client/petstore/lua/petstore/model/api_response.lua b/samples/client/petstore/lua/petstore/model/api_response.lua index 9531219b71b0..e96796dc5d06 100644 --- a/samples/client/petstore/lua/petstore/model/api_response.lua +++ b/samples/client/petstore/lua/petstore/model/api_response.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/category.lua b/samples/client/petstore/lua/petstore/model/category.lua index fd15b89da0e6..711124a4fbee 100644 --- a/samples/client/petstore/lua/petstore/model/category.lua +++ b/samples/client/petstore/lua/petstore/model/category.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/order.lua b/samples/client/petstore/lua/petstore/model/order.lua index 48a691b72d70..3b67e997f9eb 100644 --- a/samples/client/petstore/lua/petstore/model/order.lua +++ b/samples/client/petstore/lua/petstore/model/order.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/pet.lua b/samples/client/petstore/lua/petstore/model/pet.lua index 5f887e32b552..3a750e3a1a34 100644 --- a/samples/client/petstore/lua/petstore/model/pet.lua +++ b/samples/client/petstore/lua/petstore/model/pet.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/tag.lua b/samples/client/petstore/lua/petstore/model/tag.lua index 872dfab64bc7..7daf7fcc7220 100644 --- a/samples/client/petstore/lua/petstore/model/tag.lua +++ b/samples/client/petstore/lua/petstore/model/tag.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/lua/petstore/model/user.lua b/samples/client/petstore/lua/petstore/model/user.lua index 82539d731da6..c7cb44013b6a 100644 --- a/samples/client/petstore/lua/petstore/model/user.lua +++ b/samples/client/petstore/lua/petstore/model/user.lua @@ -3,7 +3,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - The version of the OpenAPI document: 1.0.0 + OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech ]] diff --git a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION index bfbf77eb7fad..096bf47efe31 100644 --- a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/README.md b/samples/client/petstore/objc/core-data/README.md index a596656fa57a..10694bd5135b 100644 --- a/samples/client/petstore/objc/core-data/README.md +++ b/samples/client/petstore/objc/core-data/README.md @@ -69,12 +69,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWithBody:body +[apiInstance addPetWithPet:pet completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h index 2753fa80578b..3783ee23362b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,12 +26,12 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Add a new pet to the store /// /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param pet Pet object that needs to be added to the store (optional) /// /// code:405 message:"Invalid input" /// /// @return void --(NSURLSessionTask*) addPetWithBody: (SWGPet*) body +-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet completionHandler: (void (^)(NSError* error)) handler; @@ -92,14 +92,14 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Update an existing pet /// /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param pet Pet object that needs to be added to the store (optional) /// /// code:400 message:"Invalid ID supplied", /// code:404 message:"Pet not found", /// code:405 message:"Validation exception" /// /// @return void --(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body +-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m index 49f8d5bc3078..e57006827b99 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m @@ -52,11 +52,11 @@ -(NSDictionary *)defaultHeaders { /// /// Add a new pet to the store /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param pet Pet object that needs to be added to the store (optional) /// /// @returns void /// --(NSURLSessionTask*) addPetWithBody: (SWGPet*) body +-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -83,7 +83,7 @@ -(NSURLSessionTask*) addPetWithBody: (SWGPet*) body id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = pet; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -193,7 +193,7 @@ -(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (status != nil) { - queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; + queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"csv"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -250,7 +250,7 @@ -(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (tags != nil) { - queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; + queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"csv"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -363,11 +363,11 @@ -(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId /// /// Update an existing pet /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param pet Pet object that needs to be added to the store (optional) /// /// @returns void /// --(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body +-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -394,7 +394,7 @@ -(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = pet; return [self.apiClient requestWithPath: resourcePath method: @"PUT" diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h index 52bc78432754..d578190189c1 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -64,13 +64,13 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// Place an order for a pet /// /// -/// @param body order placed for purchasing the pet (optional) +/// @param order order placed for purchasing the pet (optional) /// /// code:200 message:"successful operation", /// code:400 message:"Invalid Order" /// /// @return SWGOrder* --(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body +-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m index 7d102a5c0d56..4231e138bdaf 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m @@ -240,11 +240,11 @@ -(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId /// /// Place an order for a pet /// -/// @param body order placed for purchasing the pet (optional) +/// @param order order placed for purchasing the pet (optional) /// /// @returns SWGOrder* /// --(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body +-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; @@ -271,7 +271,7 @@ -(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = order; return [self.apiClient requestWithPath: resourcePath method: @"POST" diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h index 63d35eb8960b..5e0b6bbc8d83 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,36 +26,36 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Create user /// This can only be done by the logged in user. /// -/// @param body Created user object (optional) +/// @param user Created user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUserWithBody: (SWGUser*) body +-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user completionHandler: (void (^)(NSError* error)) handler; /// Creates list of users with given input array /// /// -/// @param body List of user object (optional) +/// @param user List of user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user completionHandler: (void (^)(NSError* error)) handler; /// Creates list of users with given input array /// /// -/// @param body List of user object (optional) +/// @param user List of user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user completionHandler: (void (^)(NSError* error)) handler; @@ -116,14 +116,14 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// This can only be done by the logged in user. /// /// @param username name that need to be deleted -/// @param body Updated user object (optional) +/// @param user Updated user object (optional) /// /// code:400 message:"Invalid user supplied", /// code:404 message:"User not found" /// /// @return void -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - body: (SWGUser*) body + user: (SWGUser*) user completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m index da0d9cb68314..6ba11b3a44a1 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m @@ -52,11 +52,11 @@ -(NSDictionary *)defaultHeaders { /// /// Create user /// This can only be done by the logged in user. -/// @param body Created user object (optional) +/// @param user Created user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUserWithBody: (SWGUser*) body +-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; @@ -83,7 +83,7 @@ -(NSURLSessionTask*) createUserWithBody: (SWGUser*) body id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = user; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -107,11 +107,11 @@ -(NSURLSessionTask*) createUserWithBody: (SWGUser*) body /// /// Creates list of users with given input array /// -/// @param body List of user object (optional) +/// @param user List of user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; @@ -138,7 +138,7 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = user; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -162,11 +162,11 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body /// /// Creates list of users with given input array /// -/// @param body List of user object (optional) +/// @param user List of user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; @@ -193,7 +193,7 @@ -(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = user; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -470,12 +470,12 @@ -(NSURLSessionTask*) logoutUserWithCompletionHandler: /// This can only be done by the logged in user. /// @param username name that need to be deleted /// -/// @param body Updated user object (optional) +/// @param user Updated user object (optional) /// /// @returns void /// -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - body: (SWGUser*) body + user: (SWGUser*) user completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'username' is set if (username == nil) { @@ -516,7 +516,7 @@ -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = user; return [self.apiClient requestWithPath: resourcePath method: @"PUT" diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index 5179ca2e99b8..3925ca3728f8 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h index 6c0396f0cac5..2ac4a2cdc785 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h index 04558b3d0a05..844893553809 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h @@ -7,7 +7,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h index f6b12de5c5c3..1c3c741442de 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h index e141e0d092d5..24d89beeb61e 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -93,7 +93,7 @@ /** * Sets API key * - * To remove an apiKey for an identifier, just set the apiKey to nil. + * To remove a apiKey for an identifier, just set the apiKey to nil. * * @param apiKey API key or token. * @param identifier API key identifier (authentication schema). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h index 943ab1323133..500664a38c51 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h index 23f57acd7b8a..bb3cb672c3eb 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h index 7d7112c5976a..047f52c2bb5f 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h index 4bd35d86f352..2fd7c6dbec8b 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h index 68f83704f495..e51705deb256 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ extern NSInteger const SWGUnknownResponseObjectErrorCode; @interface SWGResponseDeserializer : NSObject /** - * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored + * If an null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored * @default NO */ @property (nonatomic, assign) BOOL treatNullAsError; diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h index 83853bec8cf0..4a2bea99fd05 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h index 31eb9e6b31ca..efe582a11a46 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h index 8bcb655d0fbc..087efd870ee2 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h index 18863d14baf7..a99ae9176ff8 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h @@ -9,7 +9,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h index 5ea7a94cfcbe..11f27bdba3f8 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h index 05f83ca11fd6..1b773bbdbeb3 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h index f67159446bc9..300e63b3a852 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h @@ -9,7 +9,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h index 4b3729193265..b3586e9ea821 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h index 6ad378e95f76..d4cd41870ebf 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h index 112ba8bbff4f..dff2ad8447ea 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h @@ -11,7 +11,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h index cdcedfd916bb..991526f5d5aa 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h index a646e643d70c..a028b8ef62e7 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h index fe1abf098e0c..6c9db4e9fdaa 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h @@ -9,7 +9,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h index 7786883ed29c..de28b05c42e2 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h index 89f0f4938d81..ff3539edada6 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h index de1c284cde24..b35db434e03c 100644 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h @@ -9,7 +9,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/core-data/git_push.sh b/samples/client/petstore/objc/core-data/git_push.sh index ced3be2b0c7b..8442b80bb445 100644 --- a/samples/client/petstore/objc/core-data/git_push.sh +++ b/samples/client/petstore/objc/core-data/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -34,7 +28,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/objc/default/.openapi-generator/VERSION b/samples/client/petstore/objc/default/.openapi-generator/VERSION index bfbf77eb7fad..096bf47efe31 100644 --- a/samples/client/petstore/objc/default/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/default/README.md b/samples/client/petstore/objc/default/README.md index a596656fa57a..10694bd5135b 100644 --- a/samples/client/petstore/objc/default/README.md +++ b/samples/client/petstore/objc/default/README.md @@ -69,12 +69,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* *body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWithBody:body +[apiInstance addPetWithPet:pet completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h index 2753fa80578b..3783ee23362b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,12 +26,12 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Add a new pet to the store /// /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param pet Pet object that needs to be added to the store (optional) /// /// code:405 message:"Invalid input" /// /// @return void --(NSURLSessionTask*) addPetWithBody: (SWGPet*) body +-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet completionHandler: (void (^)(NSError* error)) handler; @@ -92,14 +92,14 @@ extern NSInteger kSWGPetApiMissingParamErrorCode; /// Update an existing pet /// /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param pet Pet object that needs to be added to the store (optional) /// /// code:400 message:"Invalid ID supplied", /// code:404 message:"Pet not found", /// code:405 message:"Validation exception" /// /// @return void --(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body +-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m index 49f8d5bc3078..e57006827b99 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m @@ -52,11 +52,11 @@ -(NSDictionary *)defaultHeaders { /// /// Add a new pet to the store /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param pet Pet object that needs to be added to the store (optional) /// /// @returns void /// --(NSURLSessionTask*) addPetWithBody: (SWGPet*) body +-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -83,7 +83,7 @@ -(NSURLSessionTask*) addPetWithBody: (SWGPet*) body id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = pet; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -193,7 +193,7 @@ -(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (status != nil) { - queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; + queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"csv"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -250,7 +250,7 @@ -(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; if (tags != nil) { - queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; + queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"csv"]; } NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; [headerParams addEntriesFromDictionary:self.defaultHeaders]; @@ -363,11 +363,11 @@ -(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId /// /// Update an existing pet /// -/// @param body Pet object that needs to be added to the store (optional) +/// @param pet Pet object that needs to be added to the store (optional) /// /// @returns void /// --(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body +-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; @@ -394,7 +394,7 @@ -(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = pet; return [self.apiClient requestWithPath: resourcePath method: @"PUT" diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h index 52bc78432754..d578190189c1 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -64,13 +64,13 @@ extern NSInteger kSWGStoreApiMissingParamErrorCode; /// Place an order for a pet /// /// -/// @param body order placed for purchasing the pet (optional) +/// @param order order placed for purchasing the pet (optional) /// /// code:200 message:"successful operation", /// code:400 message:"Invalid Order" /// /// @return SWGOrder* --(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body +-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m index 7d102a5c0d56..4231e138bdaf 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m @@ -240,11 +240,11 @@ -(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId /// /// Place an order for a pet /// -/// @param body order placed for purchasing the pet (optional) +/// @param order order placed for purchasing the pet (optional) /// /// @returns SWGOrder* /// --(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body +-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; @@ -271,7 +271,7 @@ -(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = order; return [self.apiClient requestWithPath: resourcePath method: @"POST" diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h index 63d35eb8960b..5e0b6bbc8d83 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,36 +26,36 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// Create user /// This can only be done by the logged in user. /// -/// @param body Created user object (optional) +/// @param user Created user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUserWithBody: (SWGUser*) body +-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user completionHandler: (void (^)(NSError* error)) handler; /// Creates list of users with given input array /// /// -/// @param body List of user object (optional) +/// @param user List of user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user completionHandler: (void (^)(NSError* error)) handler; /// Creates list of users with given input array /// /// -/// @param body List of user object (optional) +/// @param user List of user object (optional) /// /// code:0 message:"successful operation" /// /// @return void --(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user completionHandler: (void (^)(NSError* error)) handler; @@ -116,14 +116,14 @@ extern NSInteger kSWGUserApiMissingParamErrorCode; /// This can only be done by the logged in user. /// /// @param username name that need to be deleted -/// @param body Updated user object (optional) +/// @param user Updated user object (optional) /// /// code:400 message:"Invalid user supplied", /// code:404 message:"User not found" /// /// @return void -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - body: (SWGUser*) body + user: (SWGUser*) user completionHandler: (void (^)(NSError* error)) handler; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m index da0d9cb68314..6ba11b3a44a1 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m @@ -52,11 +52,11 @@ -(NSDictionary *)defaultHeaders { /// /// Create user /// This can only be done by the logged in user. -/// @param body Created user object (optional) +/// @param user Created user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUserWithBody: (SWGUser*) body +-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; @@ -83,7 +83,7 @@ -(NSURLSessionTask*) createUserWithBody: (SWGUser*) body id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = user; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -107,11 +107,11 @@ -(NSURLSessionTask*) createUserWithBody: (SWGUser*) body /// /// Creates list of users with given input array /// -/// @param body List of user object (optional) +/// @param user List of user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; @@ -138,7 +138,7 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = user; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -162,11 +162,11 @@ -(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body /// /// Creates list of users with given input array /// -/// @param body List of user object (optional) +/// @param user List of user object (optional) /// /// @returns void /// --(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user completionHandler: (void (^)(NSError* error)) handler { NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; @@ -193,7 +193,7 @@ -(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = user; return [self.apiClient requestWithPath: resourcePath method: @"POST" @@ -470,12 +470,12 @@ -(NSURLSessionTask*) logoutUserWithCompletionHandler: /// This can only be done by the logged in user. /// @param username name that need to be deleted /// -/// @param body Updated user object (optional) +/// @param user Updated user object (optional) /// /// @returns void /// -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - body: (SWGUser*) body + user: (SWGUser*) user completionHandler: (void (^)(NSError* error)) handler { // verify the required parameter 'username' is set if (username == nil) { @@ -516,7 +516,7 @@ -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username id bodyParam = nil; NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = body; + bodyParam = user; return [self.apiClient requestWithPath: resourcePath method: @"PUT" diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h index 5179ca2e99b8..3925ca3728f8 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h index 6c0396f0cac5..2ac4a2cdc785 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h index 04558b3d0a05..844893553809 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h @@ -7,7 +7,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h index f6b12de5c5c3..1c3c741442de 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h @@ -6,7 +6,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h index e141e0d092d5..24d89beeb61e 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -93,7 +93,7 @@ /** * Sets API key * - * To remove an apiKey for an identifier, just set the apiKey to nil. + * To remove a apiKey for an identifier, just set the apiKey to nil. * * @param apiKey API key or token. * @param identifier API key identifier (authentication schema). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h index 943ab1323133..500664a38c51 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h index 23f57acd7b8a..bb3cb672c3eb 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h index 7d7112c5976a..047f52c2bb5f 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h index 4bd35d86f352..2fd7c6dbec8b 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h index 68f83704f495..e51705deb256 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -49,7 +49,7 @@ extern NSInteger const SWGUnknownResponseObjectErrorCode; @interface SWGResponseDeserializer : NSObject /** - * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored + * If an null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored * @default NO */ @property (nonatomic, assign) BOOL treatNullAsError; diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h index 83853bec8cf0..4a2bea99fd05 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h @@ -4,7 +4,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h index 31eb9e6b31ca..efe582a11a46 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h index 5ea7a94cfcbe..11f27bdba3f8 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h index 4b3729193265..b3586e9ea821 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h index cdcedfd916bb..991526f5d5aa 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h index 7786883ed29c..de28b05c42e2 100644 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h @@ -5,7 +5,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters * -* The version of the OpenAPI document: 1.0.0 +* OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/objc/default/docs/SWGPetApi.md b/samples/client/petstore/objc/default/docs/SWGPetApi.md index 9f426a7e5ac9..e2dde91d7987 100644 --- a/samples/client/petstore/objc/default/docs/SWGPetApi.md +++ b/samples/client/petstore/objc/default/docs/SWGPetApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **addPet** ```objc --(NSURLSessionTask*) addPetWithBody: (SWGPet*) body +-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet completionHandler: (void (^)(NSError* error)) handler; ``` @@ -30,12 +30,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWithBody:body +[apiInstance addPetWithPet:pet completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGPetApi->addPet: %@", error); @@ -47,7 +47,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] + **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] ### Return type @@ -290,7 +290,7 @@ Name | Type | Description | Notes # **updatePet** ```objc --(NSURLSessionTask*) updatePetWithBody: (SWGPet*) body +-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet completionHandler: (void (^)(NSError* error)) handler; ``` @@ -304,12 +304,12 @@ SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -SWGPet* body = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) +SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; // Update an existing pet -[apiInstance updatePetWithBody:body +[apiInstance updatePetWithPet:pet completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGPetApi->updatePet: %@", error); @@ -321,7 +321,7 @@ SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] + **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] ### Return type diff --git a/samples/client/petstore/objc/default/docs/SWGStoreApi.md b/samples/client/petstore/objc/default/docs/SWGStoreApi.md index cebab19d2bfa..572b556ac041 100644 --- a/samples/client/petstore/objc/default/docs/SWGStoreApi.md +++ b/samples/client/petstore/objc/default/docs/SWGStoreApi.md @@ -162,7 +162,7 @@ No authorization required # **placeOrder** ```objc --(NSURLSessionTask*) placeOrderWithBody: (SWGOrder*) body +-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; ``` @@ -171,12 +171,12 @@ Place an order for a pet ### Example ```objc -SWGOrder* body = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional) +SWGOrder* order = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional) SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; // Place an order for a pet -[apiInstance placeOrderWithBody:body +[apiInstance placeOrderWithOrder:order completionHandler: ^(SWGOrder* output, NSError* error) { if (output) { NSLog(@"%@", output); @@ -191,7 +191,7 @@ SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional] + **order** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional] ### Return type diff --git a/samples/client/petstore/objc/default/docs/SWGUserApi.md b/samples/client/petstore/objc/default/docs/SWGUserApi.md index f512a4fdeb6f..8d28e604d0b3 100644 --- a/samples/client/petstore/objc/default/docs/SWGUserApi.md +++ b/samples/client/petstore/objc/default/docs/SWGUserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** ```objc --(NSURLSessionTask*) createUserWithBody: (SWGUser*) body +-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user completionHandler: (void (^)(NSError* error)) handler; ``` @@ -27,12 +27,12 @@ This can only be done by the logged in user. ### Example ```objc -SWGUser* body = [[SWGUser alloc] init]; // Created user object (optional) +SWGUser* user = [[SWGUser alloc] init]; // Created user object (optional) SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; // Create user -[apiInstance createUserWithBody:body +[apiInstance createUserWithUser:user completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGUserApi->createUser: %@", error); @@ -44,7 +44,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SWGUser***](SWGUser.md)| Created user object | [optional] + **user** | [**SWGUser***](SWGUser.md)| Created user object | [optional] ### Return type @@ -63,7 +63,7 @@ No authorization required # **createUsersWithArrayInput** ```objc --(NSURLSessionTask*) createUsersWithArrayInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user completionHandler: (void (^)(NSError* error)) handler; ``` @@ -72,12 +72,12 @@ Creates list of users with given input array ### Example ```objc -NSArray* body = @[[[SWGUser alloc] init]]; // List of user object (optional) +NSArray* user = @[[[NSArray alloc] init]]; // List of user object (optional) SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; // Creates list of users with given input array -[apiInstance createUsersWithArrayInputWithBody:body +[apiInstance createUsersWithArrayInputWithUser:user completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGUserApi->createUsersWithArrayInput: %@", error); @@ -89,7 +89,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] + **user** | [**NSArray<SWGUser>***](NSArray.md)| List of user object | [optional] ### Return type @@ -108,7 +108,7 @@ No authorization required # **createUsersWithListInput** ```objc --(NSURLSessionTask*) createUsersWithListInputWithBody: (NSArray*) body +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user completionHandler: (void (^)(NSError* error)) handler; ``` @@ -117,12 +117,12 @@ Creates list of users with given input array ### Example ```objc -NSArray* body = @[[[SWGUser alloc] init]]; // List of user object (optional) +NSArray* user = @[[[NSArray alloc] init]]; // List of user object (optional) SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; // Creates list of users with given input array -[apiInstance createUsersWithListInputWithBody:body +[apiInstance createUsersWithListInputWithUser:user completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGUserApi->createUsersWithListInput: %@", error); @@ -134,7 +134,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] + **user** | [**NSArray<SWGUser>***](NSArray.md)| List of user object | [optional] ### Return type @@ -342,7 +342,7 @@ No authorization required # **updateUser** ```objc -(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - body: (SWGUser*) body + user: (SWGUser*) user completionHandler: (void (^)(NSError* error)) handler; ``` @@ -354,13 +354,13 @@ This can only be done by the logged in user. ```objc NSString* username = @"username_example"; // name that need to be deleted -SWGUser* body = [[SWGUser alloc] init]; // Updated user object (optional) +SWGUser* user = [[SWGUser alloc] init]; // Updated user object (optional) SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; // Updated user [apiInstance updateUserWithUsername:username - body:body + user:user completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error calling SWGUserApi->updateUser: %@", error); @@ -373,7 +373,7 @@ SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **NSString***| name that need to be deleted | - **body** | [**SWGUser***](SWGUser.md)| Updated user object | [optional] + **user** | [**SWGUser***](SWGUser.md)| Updated user object | [optional] ### Return type diff --git a/samples/client/petstore/objc/default/git_push.sh b/samples/client/petstore/objc/default/git_push.sh index ced3be2b0c7b..8442b80bb445 100644 --- a/samples/client/petstore/objc/default/git_push.sh +++ b/samples/client/petstore/objc/default/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -34,7 +28,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/ocaml/.openapi-generator/VERSION b/samples/client/petstore/ocaml/.openapi-generator/VERSION index bfbf77eb7fad..e4955748d3e7 100644 --- a/samples/client/petstore/ocaml/.openapi-generator/VERSION +++ b/samples/client/petstore/ocaml/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/powershell/.openapi-generator/VERSION b/samples/client/petstore/powershell/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/client/petstore/powershell/.openapi-generator/VERSION +++ b/samples/client/petstore/powershell/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py index 666463c335a8..667c50612ce6 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py @@ -1804,7 +1804,7 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht collection_formats['ioutil'] = 'csv' # noqa: E501 if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501 query_params.append(('http', local_var_params['http'])) # noqa: E501 - collection_formats['http'] = 'ssv' # noqa: E501 + collection_formats['http'] = 'space' # noqa: E501 if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501 query_params.append(('url', local_var_params['url'])) # noqa: E501 collection_formats['url'] = 'csv' # noqa: E501 diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py index 666463c335a8..667c50612ce6 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py @@ -1804,7 +1804,7 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht collection_formats['ioutil'] = 'csv' # noqa: E501 if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501 query_params.append(('http', local_var_params['http'])) # noqa: E501 - collection_formats['http'] = 'ssv' # noqa: E501 + collection_formats['http'] = 'space' # noqa: E501 if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501 query_params.append(('url', local_var_params['url'])) # noqa: E501 collection_formats['url'] = 'csv' # noqa: E501 diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index 666463c335a8..667c50612ce6 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -1804,7 +1804,7 @@ def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, ht collection_formats['ioutil'] = 'csv' # noqa: E501 if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501 query_params.append(('http', local_var_params['http'])) # noqa: E501 - collection_formats['http'] = 'ssv' # noqa: E501 + collection_formats['http'] = 'space' # noqa: E501 if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501 query_params.append(('url', local_var_params['url'])) # noqa: E501 collection_formats['url'] = 'csv' # noqa: E501 diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index 1a5c080563e8..3d226aeda296 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -1038,7 +1038,7 @@ def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, ur query_params = opts[:query_params] || {} query_params[:'pipe'] = @api_client.build_collection_param(pipe, :csv) query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) - query_params[:'http'] = @api_client.build_collection_param(http, :ssv) + query_params[:'http'] = @api_client.build_collection_param(http, :space) query_params[:'url'] = @api_client.build_collection_param(url, :csv) query_params[:'context'] = @api_client.build_collection_param(context, :multi) diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 1a5c080563e8..3d226aeda296 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -1038,7 +1038,7 @@ def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, ur query_params = opts[:query_params] || {} query_params[:'pipe'] = @api_client.build_collection_param(pipe, :csv) query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) - query_params[:'http'] = @api_client.build_collection_param(http, :ssv) + query_params[:'http'] = @api_client.build_collection_param(http, :space) query_params[:'url'] = @api_client.build_collection_param(url, :csv) query_params[:'context'] = @api_client.build_collection_param(context, :multi) diff --git a/samples/client/petstore/rust/hyper/fileResponseTest/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/fileResponseTest/.openapi-generator/VERSION index bfbf77eb7fad..c3a2c7076fa8 100644 --- a/samples/client/petstore/rust/hyper/fileResponseTest/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/hyper/fileResponseTest/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION index bfbf77eb7fad..c3a2c7076fa8 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/hyper/rust-test/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/rust-test/.openapi-generator/VERSION index bfbf77eb7fad..c3a2c7076fa8 100644 --- a/samples/client/petstore/rust/hyper/rust-test/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/hyper/rust-test/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/fileResponseTest/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/fileResponseTest/.openapi-generator/VERSION index bfbf77eb7fad..c3a2c7076fa8 100644 --- a/samples/client/petstore/rust/reqwest/fileResponseTest/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/fileResponseTest/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION index bfbf77eb7fad..c3a2c7076fa8 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/rust-test/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/rust-test/.openapi-generator/VERSION index bfbf77eb7fad..c3a2c7076fa8 100644 --- a/samples/client/petstore/rust/reqwest/rust-test/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/rust-test/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/DateTimeCodecs.scala b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/DateTimeCodecs.scala index b91da00368d2..890338a8ffb6 100644 --- a/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/DateTimeCodecs.scala +++ b/samples/client/petstore/scalaz/src/main/scala/org/openapitools/client/api/DateTimeCodecs.scala @@ -4,9 +4,6 @@ import argonaut._ import argonaut.EncodeJson._ import argonaut.DecodeJson._ -import org.http4s._ -import org.http4s.{EntityDecoder, EntityEncoder} -import org.http4s.argonaut._ import java.time.OffsetDateTime object DateTimeCodecs { diff --git a/samples/client/petstore/swift/default/.openapi-generator/VERSION b/samples/client/petstore/swift/default/.openapi-generator/VERSION index bfbf77eb7fad..6d94c9c2e12a 100644 --- a/samples/client/petstore/swift/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 2e354e541811..bff5744506d7 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -5,8 +5,8 @@ // class APIHelper { - static func rejectNil(source: [String:AnyObject?]) -> [String:AnyObject]? { - var destination = [String:AnyObject]() + static func rejectNil(source: [String: AnyObject?]) -> [String: AnyObject]? { + var destination = [String: AnyObject]() for (key, nillableValue) in source { if let value: AnyObject = nillableValue { destination[key] = value @@ -19,8 +19,8 @@ class APIHelper { return destination } - static func rejectNilHeaders(source: [String:AnyObject?]) -> [String:String] { - var destination = [String:String]() + static func rejectNilHeaders(source: [String: AnyObject?]) -> [String: String] { + var destination = [String: String]() for (key, nillableValue) in source { if let value: AnyObject = nillableValue { destination[key] = "\(value)" @@ -29,11 +29,11 @@ class APIHelper { return destination } - static func convertBoolToString(source: [String: AnyObject]?) -> [String:AnyObject]? { + static func convertBoolToString(source: [String: AnyObject]?) -> [String: AnyObject]? { guard let source = source else { return nil } - var destination = [String:AnyObject]() + var destination = [String: AnyObject]() let theTrue = NSNumber(bool: true) let theFalse = NSNumber(bool: false) for (key, value) in source { diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index 1c2511ded518..676a325d49a0 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,7 +9,7 @@ import Foundation public class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io/v2" public static var credential: NSURLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } @@ -18,44 +18,44 @@ public class APIBase { let encoded: AnyObject? = encodable?.encodeToJSON() if encoded! is [AnyObject] { - var dictionary = [String:AnyObject]() + var dictionary = [String: AnyObject]() for (index, item) in (encoded as! [AnyObject]).enumerate() { dictionary["\(index)"] = item } return dictionary } else { - return encoded as? [String:AnyObject] + return encoded as? [String: AnyObject] } } } public class RequestBuilder { var credential: NSURLCredential? - var headers: [String:String] - let parameters: [String:AnyObject]? + var headers: [String: String] + let parameters: [String: AnyObject]? let isBody: Bool let method: String let URLString: String - + /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((NSProgress) -> ())? + public var onProgressReady: ((NSProgress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:AnyObject]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters self.isBody = isBody self.headers = headers - + addHeaders(PetstoreClientAPI.customHeaders) } - - public func addHeaders(aHeaders:[String:String]) { + + public func addHeaders(aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } } - + public func execute(completion: (response: Response?, error: ErrorType?) -> Void) { } public func addHeader(name name: String, value: String) -> Self { @@ -64,7 +64,7 @@ public class RequestBuilder { } return self } - + public func addCredential() -> Self { self.credential = PetstoreClientAPI.credential return self @@ -74,4 +74,3 @@ public class RequestBuilder { protocol RequestBuilderFactory { func getBuilder() -> RequestBuilder.Type } - diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 81af6c0d6292..9c663a5fabe7 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,38 +7,35 @@ import Alamofire - - public class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in + completion(error: error) } } - /** Add a new pet to the store - POST /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { + public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = pet?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -52,12 +49,11 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deletePet(petId petId: Int64, apiKey: String? = nil, completion: ((error: ErrorType?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in - completion(error: error); + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in + completion(error: error) } } - /** Deletes a pet - DELETE /pet/{petId} - OAuth: @@ -73,16 +69,16 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) let nillableHeaders: [String: AnyObject?] = [ "api_key": apiKey ] let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true, headers: headerParameters) @@ -96,11 +92,10 @@ public class PetAPI: APIBase { */ public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } - /** Finds Pets by status - GET /pet/findByStatus @@ -123,7 +118,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -132,7 +127,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -149,7 +144,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -158,7 +153,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - parameter status: (query) Status values that need to be considered for filter (optional) - returns: RequestBuilder<[Pet]> @@ -167,14 +162,14 @@ public class PetAPI: APIBase { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "status": status ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -188,11 +183,10 @@ public class PetAPI: APIBase { */ public class func findPetsByTags(tags tags: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } - /** Finds Pets by tags - GET /pet/findByTags @@ -215,7 +209,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -224,7 +218,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -241,7 +235,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -250,7 +244,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - parameter tags: (query) Tags to filter by (optional) - returns: RequestBuilder<[Pet]> @@ -259,14 +253,14 @@ public class PetAPI: APIBase { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "tags": tags ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -280,11 +274,10 @@ public class PetAPI: APIBase { */ public class func getPetById(petId petId: Int64, completion: ((data: Pet?, error: ErrorType?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } - /** Find pet by ID - GET /pet/{petId} @@ -310,7 +303,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -319,7 +312,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -336,7 +329,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -345,7 +338,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - parameter petId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -355,12 +348,12 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -369,32 +362,31 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in + completion(error: error) } } - /** Update an existing pet - PUT /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { + public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = pet?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -409,12 +401,11 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in - completion(error: error); + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in + completion(error: error) } } - /** Updates a pet in the store with form data - POST /pet/{petId} - OAuth: @@ -431,15 +422,15 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "name": name, "status": status ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -454,12 +445,11 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil, completion: ((error: ErrorType?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - completion(error: error); + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (_, error) -> Void in + completion(error: error) } } - /** uploads an image - POST /pet/{petId}/uploadImage - OAuth: @@ -476,15 +466,15 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "additionalMetadata": additionalMetadata, "file": file ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index eef30d2814c7..b745aad140b8 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,8 +7,6 @@ import Alamofire - - public class StoreAPI: APIBase { /** Delete purchase order by ID @@ -17,12 +15,11 @@ public class StoreAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deleteOrder(orderId orderId: String, completion: ((error: ErrorType?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(error: error); + deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in + completion(error: error) } } - /** Delete purchase order by ID - DELETE /store/order/{orderId} @@ -35,12 +32,12 @@ public class StoreAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -51,13 +48,12 @@ public class StoreAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ - public class func getInventory(completion: ((data: [String:Int32]?, error: ErrorType?) -> Void)) { + public class func getInventory(completion: ((data: [String: Int32]?, error: ErrorType?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } - /** Returns pet inventories by status - GET /store/inventory @@ -67,17 +63,17 @@ public class StoreAPI: APIBase { - returns: RequestBuilder<[String:Int32]> */ - public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { + public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int32]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + let requestBuilder: RequestBuilder<[String: Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) } @@ -90,11 +86,10 @@ public class StoreAPI: APIBase { */ public class func getOrderById(orderId orderId: String, completion: ((data: Order?, error: ErrorType?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } - /** Find purchase order by ID - GET /store/order/{orderId} @@ -105,14 +100,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -120,14 +115,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -, statusCode=200}] +}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -137,12 +132,12 @@ public class StoreAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -151,16 +146,15 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + completion(data: response?.body, error: error) } } - /** Place an order for a pet - POST /store/order - examples: [{contentType=application/json, example={ @@ -170,14 +164,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -185,25 +179,25 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -, statusCode=200}] - - parameter body: (body) order placed for purchasing the pet (optional) +}] + - parameter order: (body) order placed for purchasing the pet (optional) - returns: RequestBuilder */ - public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder { + public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = order?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 73760fe6268d..0f5a31fee5ee 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,36 +7,33 @@ import Alamofire - - public class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object (optional) + - parameter user: (body) Created user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (_, error) -> Void in + completion(error: error) } } - /** Create user - POST /user - - This can only be done by the logged in user. - parameter body: (body) Created user object (optional) + - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) - returns: RequestBuilder */ - public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder { + public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = user?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -45,29 +42,28 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (_, error) -> Void in + completion(error: error) } } - /** Creates list of users with given input array - - POST /user/createWithArray - parameter body: (body) List of user object (optional) + - POST /user/createWithArray - parameter user: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { + public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = user?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -76,29 +72,28 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (_, error) -> Void in + completion(error: error) } } - /** Creates list of users with given input array - - POST /user/createWithList - parameter body: (body) List of user object (optional) + - POST /user/createWithList - parameter user: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { + public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = user?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -111,12 +106,11 @@ public class UserAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deleteUser(username username: String, completion: ((error: ErrorType?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(error: error); + deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in + completion(error: error) } } - /** Delete user - DELETE /user/{username} @@ -129,12 +123,12 @@ public class UserAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -148,11 +142,10 @@ public class UserAPI: APIBase { */ public class func getUserByName(username username: String, completion: ((data: User?, error: ErrorType?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } - /** Get user by user name - GET /user/{username} - examples: [{contentType=application/json, example={ @@ -164,7 +157,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -173,7 +166,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", @@ -183,7 +176,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -192,7 +185,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -, statusCode=200}] +}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder @@ -202,12 +195,12 @@ public class UserAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -222,11 +215,10 @@ public class UserAPI: APIBase { */ public class func loginUser(username username: String? = nil, password: String? = nil, completion: ((data: String?, error: ErrorType?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } - /** Logs user into the system - GET /user/login - parameter username: (query) The user name for login (optional) @@ -238,15 +230,15 @@ public class UserAPI: APIBase { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "username": username, "password": password ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -258,12 +250,11 @@ public class UserAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func logoutUser(completion: ((error: ErrorType?) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in - completion(error: error); + logoutUserWithRequestBuilder().execute { (_, error) -> Void in + completion(error: error) } } - /** Logs out current logged in user session - GET /user/logout @@ -273,12 +264,12 @@ public class UserAPI: APIBase { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -288,32 +279,31 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updateUser(username username: String, body: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in - completion(error: error); + public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (_, error) -> Void in + completion(error: error) } } - /** Updated user - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - returns: RequestBuilder */ - public class func updateUserWithRequestBuilder(username username: String, body: User? = nil) -> RequestBuilder { + public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { var path = "/user/{username}" path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = user?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 6752df2dfc01..38e0a086d733 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -41,7 +41,7 @@ public struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() class AlamofireRequestBuilder: RequestBuilder { - required init(method: String, URLString: String, parameters: [String : AnyObject]?, isBody: Bool, headers: [String : String] = [:]) { + required init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index c04e734a7cb8..603983e248ae 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -50,7 +50,7 @@ extension Array: JSONEncodable { extension Dictionary: JSONEncodable { func encodeToJSON() -> AnyObject { - var dictionary = [NSObject:AnyObject]() + var dictionary = [NSObject: AnyObject]() for (key, value) in self { dictionary[key as! NSObject] = encodeIfPossible(value) } @@ -114,7 +114,7 @@ public final class ISOFullDate: CustomStringConvertible { [ .Year, .Month, - .Day, + .Day ], fromDate: date ) @@ -175,5 +175,3 @@ extension ISOFullDate: JSONEncodable { return "\(year)-\(month)-\(day)" } } - - diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 37d49d13e22e..774bb1737b7d 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> AnyObject } -public enum ErrorResponse : ErrorType { +public enum ErrorResponse: ErrorType { case Error(Int, NSData?, ErrorType) } @@ -27,7 +27,7 @@ public class Response { public convenience init(response: NSHTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } @@ -37,7 +37,7 @@ public class Response { private var once = dispatch_once_t() class Decoders { - static private var decoders = Dictionary AnyObject)>() + static private var decoders = [String: ((AnyObject) -] AnyObject)>() static func addDecoder(clazz clazz: T.Type, decoder: ((AnyObject) -> T)) { let key = "\(T.self)" @@ -49,9 +49,9 @@ class Decoders { return array.map { Decoders.decode(clazz: T.self, source: $0) } } - static func decode(clazz clazz: [Key:T].Type, source: AnyObject) -> [Key:T] { + static func decode(clazz clazz: [Key: T].Type, source: AnyObject) -> [Key: T] { let sourceDictionary = source as! [Key: AnyObject] - var dictionary = [Key:T]() + var dictionary = [Key: T]() for (key, value) in sourceDictionary { dictionary[key] = Decoders.decode(clazz: T.self, source: value) } @@ -61,10 +61,10 @@ class Decoders { static func decode(clazz clazz: T.Type, source: AnyObject) -> T { initialize() if T.self is Int32.Type && source is NSNumber { - return source.intValue as! T; + return source.intValue as! T } if T.self is Int64.Type && source is NSNumber { - return source.longLongValue as! T; + return source.longLongValue as! T } if T.self is NSUUID.Type && source is String { return NSUUID(UUIDString: source as! String) as! T @@ -102,11 +102,11 @@ class Decoders { } } - static func decodeOptional(clazz clazz: [Key:T].Type, source: AnyObject?) -> [Key:T]? { + static func decodeOptional(clazz clazz: [Key: T].Type, source: AnyObject?) -> [Key: T]? { if source is NSNull { return nil } - return source.map { (someSource: AnyObject) -> [Key:T] in + return source.map { (someSource: AnyObject) -> [Key: T] in Decoders.decode(clazz: clazz, source: someSource) } } @@ -121,7 +121,7 @@ class Decoders { "yyyy-MM-dd'T'HH:mm:ss.SSS" ].map { (format: String) -> NSDateFormatter in let formatter = NSDateFormatter() - formatter.locale = NSLocale(localeIdentifier:"en_US_POSIX") + formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") formatter.dateFormat = format return formatter } @@ -149,7 +149,7 @@ class Decoders { return isoDate } fatalError("formatter failed to parse \(source)") - }) + }) // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject) -> [Category] in @@ -157,71 +157,67 @@ class Decoders { } // Decoder for Category Decoders.addDecoder(clazz: Category.self) { (source: AnyObject) -> Category in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = Category() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) return instance } - // Decoder for [Order] Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject) -> [Order] in return Decoders.decode(clazz: [Order].self, source: source) } // Decoder for Order Decoders.addDecoder(clazz: Order.self) { (source: AnyObject) -> Order in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = Order() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.petId = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"]) instance.quantity = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"]) instance.shipDate = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["shipDate"]) - instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") instance.complete = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"]) return instance } - // Decoder for [Pet] Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject) -> [Pet] in return Decoders.decode(clazz: [Pet].self, source: source) } // Decoder for Pet Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject) -> Pet in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = Pet() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.category = Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"]) instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"]) - instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") return instance } - // Decoder for [Tag] Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject) -> [Tag] in return Decoders.decode(clazz: [Tag].self, source: source) } // Decoder for Tag Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject) -> Tag in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = Tag() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) return instance } - // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject) -> [User] in return Decoders.decode(clazz: [User].self, source: source) } // Decoder for User Decoders.addDecoder(clazz: User.self) { (source: AnyObject) -> User in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = User() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.username = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"]) diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index ea5e47f3cfd4..b3cbea28b69b 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,6 @@ import Foundation - public class Category: JSONEncodable { public var id: Int64? public var name: String? @@ -16,10 +15,10 @@ public class Category: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 90dfd9412255..bb7860b9483f 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,8 @@ import Foundation - public class Order: JSONEncodable { - public enum Status: String { + public enum Status: String { case Placed = "placed" case Approved = "approved" case Delivered = "delivered" @@ -26,14 +25,14 @@ public class Order: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["petId"] = self.petId?.encodeToJSON() nillableDictionary["quantity"] = self.quantity?.encodeToJSON() nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() nillableDictionary["status"] = self.status?.rawValue nillableDictionary["complete"] = self.complete - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index f24e12684e2b..5fa39ec431a4 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,8 @@ import Foundation - public class Pet: JSONEncodable { - public enum Status: String { + public enum Status: String { case Available = "available" case Pending = "pending" case Sold = "sold" @@ -26,14 +25,14 @@ public class Pet: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["category"] = self.category?.encodeToJSON() nillableDictionary["name"] = self.name nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() nillableDictionary["tags"] = self.tags?.encodeToJSON() nillableDictionary["status"] = self.status?.rawValue - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index d79d8df25ec9..df2d12e84fc1 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,6 @@ import Foundation - public class Tag: JSONEncodable { public var id: Int64? public var name: String? @@ -16,10 +15,10 @@ public class Tag: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index c4032cd38698..d24a21544177 100644 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,6 @@ import Foundation - public class User: JSONEncodable { public var id: Int64? public var username: String? @@ -23,7 +22,7 @@ public class User: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["username"] = self.username nillableDictionary["firstName"] = self.firstName @@ -32,7 +31,7 @@ public class User: JSONEncodable { nillableDictionary["password"] = self.password nillableDictionary["phone"] = self.phone nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/default/git_push.sh b/samples/client/petstore/swift/default/git_push.sh index ced3be2b0c7b..8442b80bb445 100644 --- a/samples/client/petstore/swift/default/git_push.sh +++ b/samples/client/petstore/swift/default/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -34,7 +28,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION index bfbf77eb7fad..6d94c9c2e12a 100644 --- a/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION +++ b/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 2e354e541811..bff5744506d7 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -5,8 +5,8 @@ // class APIHelper { - static func rejectNil(source: [String:AnyObject?]) -> [String:AnyObject]? { - var destination = [String:AnyObject]() + static func rejectNil(source: [String: AnyObject?]) -> [String: AnyObject]? { + var destination = [String: AnyObject]() for (key, nillableValue) in source { if let value: AnyObject = nillableValue { destination[key] = value @@ -19,8 +19,8 @@ class APIHelper { return destination } - static func rejectNilHeaders(source: [String:AnyObject?]) -> [String:String] { - var destination = [String:String]() + static func rejectNilHeaders(source: [String: AnyObject?]) -> [String: String] { + var destination = [String: String]() for (key, nillableValue) in source { if let value: AnyObject = nillableValue { destination[key] = "\(value)" @@ -29,11 +29,11 @@ class APIHelper { return destination } - static func convertBoolToString(source: [String: AnyObject]?) -> [String:AnyObject]? { + static func convertBoolToString(source: [String: AnyObject]?) -> [String: AnyObject]? { guard let source = source else { return nil } - var destination = [String:AnyObject]() + var destination = [String: AnyObject]() let theTrue = NSNumber(bool: true) let theFalse = NSNumber(bool: false) for (key, value) in source { diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift index 1c2511ded518..676a325d49a0 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,7 +9,7 @@ import Foundation public class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io/v2" public static var credential: NSURLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } @@ -18,44 +18,44 @@ public class APIBase { let encoded: AnyObject? = encodable?.encodeToJSON() if encoded! is [AnyObject] { - var dictionary = [String:AnyObject]() + var dictionary = [String: AnyObject]() for (index, item) in (encoded as! [AnyObject]).enumerate() { dictionary["\(index)"] = item } return dictionary } else { - return encoded as? [String:AnyObject] + return encoded as? [String: AnyObject] } } } public class RequestBuilder { var credential: NSURLCredential? - var headers: [String:String] - let parameters: [String:AnyObject]? + var headers: [String: String] + let parameters: [String: AnyObject]? let isBody: Bool let method: String let URLString: String - + /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((NSProgress) -> ())? + public var onProgressReady: ((NSProgress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:AnyObject]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters self.isBody = isBody self.headers = headers - + addHeaders(PetstoreClientAPI.customHeaders) } - - public func addHeaders(aHeaders:[String:String]) { + + public func addHeaders(aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } } - + public func execute(completion: (response: Response?, error: ErrorType?) -> Void) { } public func addHeader(name name: String, value: String) -> Self { @@ -64,7 +64,7 @@ public class RequestBuilder { } return self } - + public func addCredential() -> Self { self.credential = PetstoreClientAPI.credential return self @@ -74,4 +74,3 @@ public class RequestBuilder { protocol RequestBuilderFactory { func getBuilder() -> RequestBuilder.Type } - diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index ce762b3a138d..82516e473233 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,30 +8,28 @@ import Alamofire import PromiseKit - - public class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in + completion(error: error) } } /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: Promise */ - public class func addPet(body body: Pet? = nil) -> Promise { + public class func addPet(pet pet: Pet? = nil) -> Promise { let deferred = Promise.pendingPromise() - addPet(body: body) { error in + addPet(pet: pet) { error in if let error = error { deferred.reject(error) } else { @@ -46,17 +44,17 @@ public class PetAPI: APIBase { - POST /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { + public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = pet?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -70,8 +68,8 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deletePet(petId petId: Int64, apiKey: String? = nil, completion: ((error: ErrorType?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in - completion(error: error); + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in + completion(error: error) } } @@ -109,16 +107,16 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) let nillableHeaders: [String: AnyObject?] = [ "api_key": apiKey ] let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true, headers: headerParameters) @@ -132,7 +130,7 @@ public class PetAPI: APIBase { */ public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -176,7 +174,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -185,7 +183,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -202,7 +200,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -211,7 +209,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - parameter status: (query) Status values that need to be considered for filter (optional) - returns: RequestBuilder<[Pet]> @@ -220,14 +218,14 @@ public class PetAPI: APIBase { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "status": status ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -241,7 +239,7 @@ public class PetAPI: APIBase { */ public class func findPetsByTags(tags tags: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -285,7 +283,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -294,7 +292,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -311,7 +309,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -320,7 +318,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - parameter tags: (query) Tags to filter by (optional) - returns: RequestBuilder<[Pet]> @@ -329,14 +327,14 @@ public class PetAPI: APIBase { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "tags": tags ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -350,7 +348,7 @@ public class PetAPI: APIBase { */ public class func getPetById(petId petId: Int64, completion: ((data: Pet?, error: ErrorType?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -397,7 +395,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -406,7 +404,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -423,7 +421,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -432,7 +430,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - parameter petId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -442,12 +440,12 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -456,24 +454,24 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in + completion(error: error) } } /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: Promise */ - public class func updatePet(body body: Pet? = nil) -> Promise { + public class func updatePet(pet pet: Pet? = nil) -> Promise { let deferred = Promise.pendingPromise() - updatePet(body: body) { error in + updatePet(pet: pet) { error in if let error = error { deferred.reject(error) } else { @@ -488,17 +486,17 @@ public class PetAPI: APIBase { - PUT /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { + public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = pet?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -513,8 +511,8 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in - completion(error: error); + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in + completion(error: error) } } @@ -554,15 +552,15 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "name": name, "status": status ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -577,8 +575,8 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil, completion: ((error: ErrorType?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - completion(error: error); + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (_, error) -> Void in + completion(error: error) } } @@ -618,15 +616,15 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "additionalMetadata": additionalMetadata, "file": file ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index b9ae6984e129..9f2fd4ee2693 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,8 +8,6 @@ import Alamofire import PromiseKit - - public class StoreAPI: APIBase { /** Delete purchase order by ID @@ -18,8 +16,8 @@ public class StoreAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deleteOrder(orderId orderId: String, completion: ((error: ErrorType?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(error: error); + deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in + completion(error: error) } } @@ -53,12 +51,12 @@ public class StoreAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -69,9 +67,9 @@ public class StoreAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ - public class func getInventory(completion: ((data: [String:Int32]?, error: ErrorType?) -> Void)) { + public class func getInventory(completion: ((data: [String: Int32]?, error: ErrorType?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -80,9 +78,9 @@ public class StoreAPI: APIBase { - returns: Promise<[String:Int32]> */ - public class func getInventory() -> Promise<[String:Int32]> { - let deferred = Promise<[String:Int32]>.pendingPromise() - getInventory() { data, error in + public class func getInventory() -> Promise<[String: Int32]> { + let deferred = Promise<[String: Int32]>.pendingPromise() + getInventory { data, error in if let error = error { deferred.reject(error) } else { @@ -101,17 +99,17 @@ public class StoreAPI: APIBase { - returns: RequestBuilder<[String:Int32]> */ - public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { + public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int32]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + let requestBuilder: RequestBuilder<[String: Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) } @@ -124,7 +122,7 @@ public class StoreAPI: APIBase { */ public class func getOrderById(orderId orderId: String, completion: ((data: Order?, error: ErrorType?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -156,14 +154,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -171,14 +169,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -, statusCode=200}] +}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -188,12 +186,12 @@ public class StoreAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -202,24 +200,24 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + completion(data: response?.body, error: error) } } /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - returns: Promise */ - public class func placeOrder(body body: Order? = nil) -> Promise { + public class func placeOrder(order order: Order? = nil) -> Promise { let deferred = Promise.pendingPromise() - placeOrder(body: body) { data, error in + placeOrder(order: order) { data, error in if let error = error { deferred.reject(error) } else { @@ -238,14 +236,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -253,25 +251,25 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -, statusCode=200}] - - parameter body: (body) order placed for purchasing the pet (optional) +}] + - parameter order: (body) order placed for purchasing the pet (optional) - returns: RequestBuilder */ - public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder { + public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = order?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 573b8fe14bc7..f1030ea58794 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,30 +8,28 @@ import Alamofire import PromiseKit - - public class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object (optional) + - parameter user: (body) Created user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (_, error) -> Void in + completion(error: error) } } /** Create user - - parameter body: (body) Created user object (optional) + - parameter user: (body) Created user object (optional) - returns: Promise */ - public class func createUser(body body: User? = nil) -> Promise { + public class func createUser(user user: User? = nil) -> Promise { let deferred = Promise.pendingPromise() - createUser(body: body) { error in + createUser(user: user) { error in if let error = error { deferred.reject(error) } else { @@ -44,17 +42,17 @@ public class UserAPI: APIBase { /** Create user - POST /user - - This can only be done by the logged in user. - parameter body: (body) Created user object (optional) + - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) - returns: RequestBuilder */ - public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder { + public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = user?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -63,24 +61,24 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (_, error) -> Void in + completion(error: error) } } /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - returns: Promise */ - public class func createUsersWithArrayInput(body body: [User]? = nil) -> Promise { + public class func createUsersWithArrayInput(user user: [User]? = nil) -> Promise { let deferred = Promise.pendingPromise() - createUsersWithArrayInput(body: body) { error in + createUsersWithArrayInput(user: user) { error in if let error = error { deferred.reject(error) } else { @@ -92,17 +90,17 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithArray - parameter body: (body) List of user object (optional) + - POST /user/createWithArray - parameter user: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { + public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = user?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -111,24 +109,24 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (_, error) -> Void in + completion(error: error) } } /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - returns: Promise */ - public class func createUsersWithListInput(body body: [User]? = nil) -> Promise { + public class func createUsersWithListInput(user user: [User]? = nil) -> Promise { let deferred = Promise.pendingPromise() - createUsersWithListInput(body: body) { error in + createUsersWithListInput(user: user) { error in if let error = error { deferred.reject(error) } else { @@ -140,17 +138,17 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithList - parameter body: (body) List of user object (optional) + - POST /user/createWithList - parameter user: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { + public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = user?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -163,8 +161,8 @@ public class UserAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deleteUser(username username: String, completion: ((error: ErrorType?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(error: error); + deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in + completion(error: error) } } @@ -198,12 +196,12 @@ public class UserAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -217,7 +215,7 @@ public class UserAPI: APIBase { */ public class func getUserByName(username username: String, completion: ((data: User?, error: ErrorType?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -250,7 +248,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -259,7 +257,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", @@ -269,7 +267,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -278,7 +276,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -, statusCode=200}] +}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder @@ -288,12 +286,12 @@ public class UserAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -308,7 +306,7 @@ public class UserAPI: APIBase { */ public class func loginUser(username username: String? = nil, password: String? = nil, completion: ((data: String?, error: ErrorType?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -342,15 +340,15 @@ public class UserAPI: APIBase { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "username": username, "password": password ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -362,8 +360,8 @@ public class UserAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func logoutUser(completion: ((error: ErrorType?) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in - completion(error: error); + logoutUserWithRequestBuilder().execute { (_, error) -> Void in + completion(error: error) } } @@ -374,7 +372,7 @@ public class UserAPI: APIBase { */ public class func logoutUser() -> Promise { let deferred = Promise.pendingPromise() - logoutUser() { error in + logoutUser { error in if let error = error { deferred.reject(error) } else { @@ -393,12 +391,12 @@ public class UserAPI: APIBase { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -408,12 +406,12 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updateUser(username username: String, body: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in - completion(error: error); + public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (_, error) -> Void in + completion(error: error) } } @@ -421,12 +419,12 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - returns: Promise */ - public class func updateUser(username username: String, body: User? = nil) -> Promise { + public class func updateUser(username username: String, user: User? = nil) -> Promise { let deferred = Promise.pendingPromise() - updateUser(username: username, body: body) { error in + updateUser(username: username, user: user) { error in if let error = error { deferred.reject(error) } else { @@ -440,18 +438,18 @@ public class UserAPI: APIBase { Updated user - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - returns: RequestBuilder */ - public class func updateUserWithRequestBuilder(username username: String, body: User? = nil) -> RequestBuilder { + public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { var path = "/user/{username}" path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = user?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 6752df2dfc01..38e0a086d733 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -41,7 +41,7 @@ public struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() class AlamofireRequestBuilder: RequestBuilder { - required init(method: String, URLString: String, parameters: [String : AnyObject]?, isBody: Bool, headers: [String : String] = [:]) { + required init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 5911dd589c09..eaa10fa3763c 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -51,7 +51,7 @@ extension Array: JSONEncodable { extension Dictionary: JSONEncodable { func encodeToJSON() -> AnyObject { - var dictionary = [NSObject:AnyObject]() + var dictionary = [NSObject: AnyObject]() for (key, value) in self { dictionary[key as! NSObject] = encodeIfPossible(value) } @@ -115,7 +115,7 @@ public final class ISOFullDate: CustomStringConvertible { [ .Year, .Month, - .Day, + .Day ], fromDate: date ) @@ -178,7 +178,7 @@ extension ISOFullDate: JSONEncodable { } extension RequestBuilder { - public func execute() -> Promise> { + public func execute() -> Promise> { let deferred = Promise>.pendingPromise() self.execute { (response: Response?, error: ErrorType?) in if let response = response { diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift index 37d49d13e22e..774bb1737b7d 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> AnyObject } -public enum ErrorResponse : ErrorType { +public enum ErrorResponse: ErrorType { case Error(Int, NSData?, ErrorType) } @@ -27,7 +27,7 @@ public class Response { public convenience init(response: NSHTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } @@ -37,7 +37,7 @@ public class Response { private var once = dispatch_once_t() class Decoders { - static private var decoders = Dictionary AnyObject)>() + static private var decoders = [String: ((AnyObject) -] AnyObject)>() static func addDecoder(clazz clazz: T.Type, decoder: ((AnyObject) -> T)) { let key = "\(T.self)" @@ -49,9 +49,9 @@ class Decoders { return array.map { Decoders.decode(clazz: T.self, source: $0) } } - static func decode(clazz clazz: [Key:T].Type, source: AnyObject) -> [Key:T] { + static func decode(clazz clazz: [Key: T].Type, source: AnyObject) -> [Key: T] { let sourceDictionary = source as! [Key: AnyObject] - var dictionary = [Key:T]() + var dictionary = [Key: T]() for (key, value) in sourceDictionary { dictionary[key] = Decoders.decode(clazz: T.self, source: value) } @@ -61,10 +61,10 @@ class Decoders { static func decode(clazz clazz: T.Type, source: AnyObject) -> T { initialize() if T.self is Int32.Type && source is NSNumber { - return source.intValue as! T; + return source.intValue as! T } if T.self is Int64.Type && source is NSNumber { - return source.longLongValue as! T; + return source.longLongValue as! T } if T.self is NSUUID.Type && source is String { return NSUUID(UUIDString: source as! String) as! T @@ -102,11 +102,11 @@ class Decoders { } } - static func decodeOptional(clazz clazz: [Key:T].Type, source: AnyObject?) -> [Key:T]? { + static func decodeOptional(clazz clazz: [Key: T].Type, source: AnyObject?) -> [Key: T]? { if source is NSNull { return nil } - return source.map { (someSource: AnyObject) -> [Key:T] in + return source.map { (someSource: AnyObject) -> [Key: T] in Decoders.decode(clazz: clazz, source: someSource) } } @@ -121,7 +121,7 @@ class Decoders { "yyyy-MM-dd'T'HH:mm:ss.SSS" ].map { (format: String) -> NSDateFormatter in let formatter = NSDateFormatter() - formatter.locale = NSLocale(localeIdentifier:"en_US_POSIX") + formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") formatter.dateFormat = format return formatter } @@ -149,7 +149,7 @@ class Decoders { return isoDate } fatalError("formatter failed to parse \(source)") - }) + }) // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject) -> [Category] in @@ -157,71 +157,67 @@ class Decoders { } // Decoder for Category Decoders.addDecoder(clazz: Category.self) { (source: AnyObject) -> Category in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = Category() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) return instance } - // Decoder for [Order] Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject) -> [Order] in return Decoders.decode(clazz: [Order].self, source: source) } // Decoder for Order Decoders.addDecoder(clazz: Order.self) { (source: AnyObject) -> Order in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = Order() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.petId = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"]) instance.quantity = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"]) instance.shipDate = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["shipDate"]) - instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") instance.complete = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"]) return instance } - // Decoder for [Pet] Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject) -> [Pet] in return Decoders.decode(clazz: [Pet].self, source: source) } // Decoder for Pet Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject) -> Pet in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = Pet() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.category = Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"]) instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"]) - instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") return instance } - // Decoder for [Tag] Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject) -> [Tag] in return Decoders.decode(clazz: [Tag].self, source: source) } // Decoder for Tag Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject) -> Tag in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = Tag() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) return instance } - // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject) -> [User] in return Decoders.decode(clazz: [User].self, source: source) } // Decoder for User Decoders.addDecoder(clazz: User.self) { (source: AnyObject) -> User in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = User() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.username = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"]) diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index ea5e47f3cfd4..b3cbea28b69b 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,6 @@ import Foundation - public class Category: JSONEncodable { public var id: Int64? public var name: String? @@ -16,10 +15,10 @@ public class Category: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 90dfd9412255..bb7860b9483f 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,8 @@ import Foundation - public class Order: JSONEncodable { - public enum Status: String { + public enum Status: String { case Placed = "placed" case Approved = "approved" case Delivered = "delivered" @@ -26,14 +25,14 @@ public class Order: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["petId"] = self.petId?.encodeToJSON() nillableDictionary["quantity"] = self.quantity?.encodeToJSON() nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() nillableDictionary["status"] = self.status?.rawValue nillableDictionary["complete"] = self.complete - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index f24e12684e2b..5fa39ec431a4 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,8 @@ import Foundation - public class Pet: JSONEncodable { - public enum Status: String { + public enum Status: String { case Available = "available" case Pending = "pending" case Sold = "sold" @@ -26,14 +25,14 @@ public class Pet: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["category"] = self.category?.encodeToJSON() nillableDictionary["name"] = self.name nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() nillableDictionary["tags"] = self.tags?.encodeToJSON() nillableDictionary["status"] = self.status?.rawValue - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index d79d8df25ec9..df2d12e84fc1 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,6 @@ import Foundation - public class Tag: JSONEncodable { public var id: Int64? public var name: String? @@ -16,10 +15,10 @@ public class Tag: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift index c4032cd38698..d24a21544177 100644 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,6 @@ import Foundation - public class User: JSONEncodable { public var id: Int64? public var username: String? @@ -23,7 +22,7 @@ public class User: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["username"] = self.username nillableDictionary["firstName"] = self.firstName @@ -32,7 +31,7 @@ public class User: JSONEncodable { nillableDictionary["password"] = self.password nillableDictionary["phone"] = self.phone nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/promisekit/git_push.sh b/samples/client/petstore/swift/promisekit/git_push.sh index ced3be2b0c7b..8442b80bb445 100644 --- a/samples/client/petstore/swift/promisekit/git_push.sh +++ b/samples/client/petstore/swift/promisekit/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -34,7 +28,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION index bfbf77eb7fad..6d94c9c2e12a 100644 --- a/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION +++ b/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 2e354e541811..bff5744506d7 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -5,8 +5,8 @@ // class APIHelper { - static func rejectNil(source: [String:AnyObject?]) -> [String:AnyObject]? { - var destination = [String:AnyObject]() + static func rejectNil(source: [String: AnyObject?]) -> [String: AnyObject]? { + var destination = [String: AnyObject]() for (key, nillableValue) in source { if let value: AnyObject = nillableValue { destination[key] = value @@ -19,8 +19,8 @@ class APIHelper { return destination } - static func rejectNilHeaders(source: [String:AnyObject?]) -> [String:String] { - var destination = [String:String]() + static func rejectNilHeaders(source: [String: AnyObject?]) -> [String: String] { + var destination = [String: String]() for (key, nillableValue) in source { if let value: AnyObject = nillableValue { destination[key] = "\(value)" @@ -29,11 +29,11 @@ class APIHelper { return destination } - static func convertBoolToString(source: [String: AnyObject]?) -> [String:AnyObject]? { + static func convertBoolToString(source: [String: AnyObject]?) -> [String: AnyObject]? { guard let source = source else { return nil } - var destination = [String:AnyObject]() + var destination = [String: AnyObject]() let theTrue = NSNumber(bool: true) let theFalse = NSNumber(bool: false) for (key, value) in source { diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift index 1c2511ded518..676a325d49a0 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,7 +9,7 @@ import Foundation public class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io/v2" public static var credential: NSURLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() } @@ -18,44 +18,44 @@ public class APIBase { let encoded: AnyObject? = encodable?.encodeToJSON() if encoded! is [AnyObject] { - var dictionary = [String:AnyObject]() + var dictionary = [String: AnyObject]() for (index, item) in (encoded as! [AnyObject]).enumerate() { dictionary["\(index)"] = item } return dictionary } else { - return encoded as? [String:AnyObject] + return encoded as? [String: AnyObject] } } } public class RequestBuilder { var credential: NSURLCredential? - var headers: [String:String] - let parameters: [String:AnyObject]? + var headers: [String: String] + let parameters: [String: AnyObject]? let isBody: Bool let method: String let URLString: String - + /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((NSProgress) -> ())? + public var onProgressReady: ((NSProgress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:AnyObject]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters self.isBody = isBody self.headers = headers - + addHeaders(PetstoreClientAPI.customHeaders) } - - public func addHeaders(aHeaders:[String:String]) { + + public func addHeaders(aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } } - + public func execute(completion: (response: Response?, error: ErrorType?) -> Void) { } public func addHeader(name name: String, value: String) -> Self { @@ -64,7 +64,7 @@ public class RequestBuilder { } return self } - + public func addCredential() -> Self { self.credential = PetstoreClientAPI.credential return self @@ -74,4 +74,3 @@ public class RequestBuilder { protocol RequestBuilderFactory { func getBuilder() -> RequestBuilder.Type } - diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 3ac74dad3240..866607dc04fa 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,30 +8,28 @@ import Alamofire import RxSwift - - public class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func addPet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in + completion(error: error) } } /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: Observable */ - public class func addPet(body body: Pet? = nil) -> Observable { + public class func addPet(pet pet: Pet? = nil) -> Observable { return Observable.create { observer -> Disposable in - addPet(body: body) { error in + addPet(pet: pet) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -48,17 +46,17 @@ public class PetAPI: APIBase { - POST /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func addPetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { + public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = pet?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -72,8 +70,8 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deletePet(petId petId: Int64, apiKey: String? = nil, completion: ((error: ErrorType?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in - completion(error: error); + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in + completion(error: error) } } @@ -113,16 +111,16 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) let nillableHeaders: [String: AnyObject?] = [ "api_key": apiKey ] let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true, headers: headerParameters) @@ -136,7 +134,7 @@ public class PetAPI: APIBase { */ public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -182,7 +180,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -191,7 +189,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -208,7 +206,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -217,7 +215,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - parameter status: (query) Status values that need to be considered for filter (optional) - returns: RequestBuilder<[Pet]> @@ -226,14 +224,14 @@ public class PetAPI: APIBase { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "status": status ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -247,7 +245,7 @@ public class PetAPI: APIBase { */ public class func findPetsByTags(tags tags: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -293,7 +291,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -302,7 +300,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -319,7 +317,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -328,7 +326,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - parameter tags: (query) Tags to filter by (optional) - returns: RequestBuilder<[Pet]> @@ -337,14 +335,14 @@ public class PetAPI: APIBase { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "tags": tags ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -358,7 +356,7 @@ public class PetAPI: APIBase { */ public class func getPetById(petId petId: Int64, completion: ((data: Pet?, error: ErrorType?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -407,7 +405,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -416,7 +414,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -433,7 +431,7 @@ public class PetAPI: APIBase { "id" : 1 } ], "status" : "available" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 doggie @@ -442,7 +440,7 @@ public class PetAPI: APIBase { aeiou -, statusCode=200}] +}] - parameter petId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -452,12 +450,12 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -466,24 +464,24 @@ public class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updatePet(body body: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in + completion(error: error) } } /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: Observable */ - public class func updatePet(body body: Pet? = nil) -> Observable { + public class func updatePet(pet pet: Pet? = nil) -> Observable { return Observable.create { observer -> Disposable in - updatePet(body: body) { error in + updatePet(pet: pet) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -500,17 +498,17 @@ public class PetAPI: APIBase { - PUT /pet - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store (optional) + - parameter pet: (body) Pet object that needs to be added to the store (optional) - returns: RequestBuilder */ - public class func updatePetWithRequestBuilder(body body: Pet? = nil) -> RequestBuilder { + public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = pet?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -525,8 +523,8 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in - completion(error: error); + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in + completion(error: error) } } @@ -568,15 +566,15 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "name": name, "status": status ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -591,8 +589,8 @@ public class PetAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil, completion: ((error: ErrorType?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - completion(error: error); + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (_, error) -> Void in + completion(error: error) } } @@ -634,15 +632,15 @@ public class PetAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "additionalMetadata": additionalMetadata, "file": file ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 42eafcf8e6b1..cc8873bdd9f8 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,8 +8,6 @@ import Alamofire import RxSwift - - public class StoreAPI: APIBase { /** Delete purchase order by ID @@ -18,8 +16,8 @@ public class StoreAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deleteOrder(orderId orderId: String, completion: ((error: ErrorType?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(error: error); + deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in + completion(error: error) } } @@ -55,12 +53,12 @@ public class StoreAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -71,9 +69,9 @@ public class StoreAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ - public class func getInventory(completion: ((data: [String:Int32]?, error: ErrorType?) -> Void)) { + public class func getInventory(completion: ((data: [String: Int32]?, error: ErrorType?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -82,9 +80,9 @@ public class StoreAPI: APIBase { - returns: Observable<[String:Int32]> */ - public class func getInventory() -> Observable<[String:Int32]> { + public class func getInventory() -> Observable<[String: Int32]> { return Observable.create { observer -> Disposable in - getInventory() { data, error in + getInventory { data, error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -105,17 +103,17 @@ public class StoreAPI: APIBase { - returns: RequestBuilder<[String:Int32]> */ - public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { + public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int32]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + let requestBuilder: RequestBuilder<[String: Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) } @@ -128,7 +126,7 @@ public class StoreAPI: APIBase { */ public class func getOrderById(orderId orderId: String, completion: ((data: Order?, error: ErrorType?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -162,14 +160,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -177,14 +175,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -, statusCode=200}] +}] - parameter orderId: (path) ID of pet that needs to be fetched - returns: RequestBuilder @@ -194,12 +192,12 @@ public class StoreAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -208,24 +206,24 @@ public class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func placeOrder(body body: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + completion(data: response?.body, error: error) } } /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet (optional) + - parameter order: (body) order placed for purchasing the pet (optional) - returns: Observable */ - public class func placeOrder(body body: Order? = nil) -> Observable { + public class func placeOrder(order order: Order? = nil) -> Observable { return Observable.create { observer -> Disposable in - placeOrder(body: body) { data, error in + placeOrder(order: order) { data, error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -246,14 +244,14 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "petId" : 6, "quantity" : 1, @@ -261,25 +259,25 @@ public class StoreAPI: APIBase { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : true, "status" : "placed" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true -, statusCode=200}] - - parameter body: (body) order placed for purchasing the pet (optional) +}] + - parameter order: (body) order placed for purchasing the pet (optional) - returns: RequestBuilder */ - public class func placeOrderWithRequestBuilder(body body: Order? = nil) -> RequestBuilder { + public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = order?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index c0db2bfc8ea0..fae0dd5f6eda 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,30 +8,28 @@ import Alamofire import RxSwift - - public class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object (optional) + - parameter user: (body) Created user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUser(body body: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (_, error) -> Void in + completion(error: error) } } /** Create user - - parameter body: (body) Created user object (optional) + - parameter user: (body) Created user object (optional) - returns: Observable */ - public class func createUser(body body: User? = nil) -> Observable { + public class func createUser(user user: User? = nil) -> Observable { return Observable.create { observer -> Disposable in - createUser(body: body) { error in + createUser(user: user) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -46,17 +44,17 @@ public class UserAPI: APIBase { /** Create user - POST /user - - This can only be done by the logged in user. - parameter body: (body) Created user object (optional) + - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) - returns: RequestBuilder */ - public class func createUserWithRequestBuilder(body body: User? = nil) -> RequestBuilder { + public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = user?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -65,24 +63,24 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithArrayInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (_, error) -> Void in + completion(error: error) } } /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - returns: Observable */ - public class func createUsersWithArrayInput(body body: [User]? = nil) -> Observable { + public class func createUsersWithArrayInput(user user: [User]? = nil) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithArrayInput(body: body) { error in + createUsersWithArrayInput(user: user) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -96,17 +94,17 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithArray - parameter body: (body) List of user object (optional) + - POST /user/createWithArray - parameter user: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithArrayInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { + public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = user?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -115,24 +113,24 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func createUsersWithListInput(body body: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error: error); + public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (_, error) -> Void in + completion(error: error) } } /** Creates list of users with given input array - - parameter body: (body) List of user object (optional) + - parameter user: (body) List of user object (optional) - returns: Observable */ - public class func createUsersWithListInput(body body: [User]? = nil) -> Observable { + public class func createUsersWithListInput(user user: [User]? = nil) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithListInput(body: body) { error in + createUsersWithListInput(user: user) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -146,17 +144,17 @@ public class UserAPI: APIBase { /** Creates list of users with given input array - - POST /user/createWithList - parameter body: (body) List of user object (optional) + - POST /user/createWithList - parameter user: (body) List of user object (optional) - returns: RequestBuilder */ - public class func createUsersWithListInputWithRequestBuilder(body body: [User]? = nil) -> RequestBuilder { + public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = user?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -169,8 +167,8 @@ public class UserAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func deleteUser(username username: String, completion: ((error: ErrorType?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(error: error); + deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in + completion(error: error) } } @@ -206,12 +204,12 @@ public class UserAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -225,7 +223,7 @@ public class UserAPI: APIBase { */ public class func getUserByName(username username: String, completion: ((data: User?, error: ErrorType?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -260,7 +258,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -269,7 +267,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -, statusCode=200}] +}] - examples: [{contentType=application/json, example={ "firstName" : "firstName", "lastName" : "lastName", @@ -279,7 +277,7 @@ public class UserAPI: APIBase { "id" : 0, "email" : "email", "username" : "username" -}, statusCode=200}, {contentType=application/xml, example= +}}, {contentType=application/xml, example= 123456789 aeiou aeiou @@ -288,7 +286,7 @@ public class UserAPI: APIBase { aeiou aeiou 123 -, statusCode=200}] +}] - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder @@ -298,12 +296,12 @@ public class UserAPI: APIBase { path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -318,7 +316,7 @@ public class UserAPI: APIBase { */ public class func loginUser(username username: String? = nil, password: String? = nil, completion: ((data: String?, error: ErrorType?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(data: response?.body, error: error); + completion(data: response?.body, error: error) } } @@ -354,15 +352,15 @@ public class UserAPI: APIBase { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [ + let nillableParameters: [String: AnyObject?] = [ "username": username, "password": password ] - + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) @@ -374,8 +372,8 @@ public class UserAPI: APIBase { - parameter completion: completion handler to receive the data and the error objects */ public class func logoutUser(completion: ((error: ErrorType?) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in - completion(error: error); + logoutUserWithRequestBuilder().execute { (_, error) -> Void in + completion(error: error) } } @@ -386,7 +384,7 @@ public class UserAPI: APIBase { */ public class func logoutUser() -> Observable { return Observable.create { observer -> Disposable in - logoutUser() { error in + logoutUser { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -407,12 +405,12 @@ public class UserAPI: APIBase { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let nillableParameters: [String:AnyObject?] = [:] - + let nillableParameters: [String: AnyObject?] = [:] + let parameters = APIHelper.rejectNil(nillableParameters) - + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) @@ -422,12 +420,12 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - parameter completion: completion handler to receive the data and the error objects */ - public class func updateUser(username username: String, body: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in - completion(error: error); + public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (_, error) -> Void in + completion(error: error) } } @@ -435,12 +433,12 @@ public class UserAPI: APIBase { Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - returns: Observable */ - public class func updateUser(username username: String, body: User? = nil) -> Observable { + public class func updateUser(username username: String, user: User? = nil) -> Observable { return Observable.create { observer -> Disposable in - updateUser(username: username, body: body) { error in + updateUser(username: username, user: user) { error in if let error = error { observer.on(.Error(error as ErrorType)) } else { @@ -456,18 +454,18 @@ public class UserAPI: APIBase { Updated user - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object (optional) + - parameter user: (body) Updated user object (optional) - returns: RequestBuilder */ - public class func updateUserWithRequestBuilder(username username: String, body: User? = nil) -> RequestBuilder { + public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { var path = "/user/{username}" path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() as? [String:AnyObject] - + let parameters = user?.encodeToJSON() as? [String: AnyObject] + let convertedParameters = APIHelper.convertBoolToString(parameters) - + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 6752df2dfc01..38e0a086d733 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -41,7 +41,7 @@ public struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() class AlamofireRequestBuilder: RequestBuilder { - required init(method: String, URLString: String, parameters: [String : AnyObject]?, isBody: Bool, headers: [String : String] = [:]) { + required init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift index c04e734a7cb8..603983e248ae 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -50,7 +50,7 @@ extension Array: JSONEncodable { extension Dictionary: JSONEncodable { func encodeToJSON() -> AnyObject { - var dictionary = [NSObject:AnyObject]() + var dictionary = [NSObject: AnyObject]() for (key, value) in self { dictionary[key as! NSObject] = encodeIfPossible(value) } @@ -114,7 +114,7 @@ public final class ISOFullDate: CustomStringConvertible { [ .Year, .Month, - .Day, + .Day ], fromDate: date ) @@ -175,5 +175,3 @@ extension ISOFullDate: JSONEncodable { return "\(year)-\(month)-\(day)" } } - - diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift index 37d49d13e22e..774bb1737b7d 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> AnyObject } -public enum ErrorResponse : ErrorType { +public enum ErrorResponse: ErrorType { case Error(Int, NSData?, ErrorType) } @@ -27,7 +27,7 @@ public class Response { public convenience init(response: NSHTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } @@ -37,7 +37,7 @@ public class Response { private var once = dispatch_once_t() class Decoders { - static private var decoders = Dictionary AnyObject)>() + static private var decoders = [String: ((AnyObject) -] AnyObject)>() static func addDecoder(clazz clazz: T.Type, decoder: ((AnyObject) -> T)) { let key = "\(T.self)" @@ -49,9 +49,9 @@ class Decoders { return array.map { Decoders.decode(clazz: T.self, source: $0) } } - static func decode(clazz clazz: [Key:T].Type, source: AnyObject) -> [Key:T] { + static func decode(clazz clazz: [Key: T].Type, source: AnyObject) -> [Key: T] { let sourceDictionary = source as! [Key: AnyObject] - var dictionary = [Key:T]() + var dictionary = [Key: T]() for (key, value) in sourceDictionary { dictionary[key] = Decoders.decode(clazz: T.self, source: value) } @@ -61,10 +61,10 @@ class Decoders { static func decode(clazz clazz: T.Type, source: AnyObject) -> T { initialize() if T.self is Int32.Type && source is NSNumber { - return source.intValue as! T; + return source.intValue as! T } if T.self is Int64.Type && source is NSNumber { - return source.longLongValue as! T; + return source.longLongValue as! T } if T.self is NSUUID.Type && source is String { return NSUUID(UUIDString: source as! String) as! T @@ -102,11 +102,11 @@ class Decoders { } } - static func decodeOptional(clazz clazz: [Key:T].Type, source: AnyObject?) -> [Key:T]? { + static func decodeOptional(clazz clazz: [Key: T].Type, source: AnyObject?) -> [Key: T]? { if source is NSNull { return nil } - return source.map { (someSource: AnyObject) -> [Key:T] in + return source.map { (someSource: AnyObject) -> [Key: T] in Decoders.decode(clazz: clazz, source: someSource) } } @@ -121,7 +121,7 @@ class Decoders { "yyyy-MM-dd'T'HH:mm:ss.SSS" ].map { (format: String) -> NSDateFormatter in let formatter = NSDateFormatter() - formatter.locale = NSLocale(localeIdentifier:"en_US_POSIX") + formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") formatter.dateFormat = format return formatter } @@ -149,7 +149,7 @@ class Decoders { return isoDate } fatalError("formatter failed to parse \(source)") - }) + }) // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject) -> [Category] in @@ -157,71 +157,67 @@ class Decoders { } // Decoder for Category Decoders.addDecoder(clazz: Category.self) { (source: AnyObject) -> Category in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = Category() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) return instance } - // Decoder for [Order] Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject) -> [Order] in return Decoders.decode(clazz: [Order].self, source: source) } // Decoder for Order Decoders.addDecoder(clazz: Order.self) { (source: AnyObject) -> Order in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = Order() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.petId = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"]) instance.quantity = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"]) instance.shipDate = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["shipDate"]) - instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") instance.complete = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"]) return instance } - // Decoder for [Pet] Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject) -> [Pet] in return Decoders.decode(clazz: [Pet].self, source: source) } // Decoder for Pet Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject) -> Pet in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = Pet() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.category = Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"]) instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"]) - instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") + instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") return instance } - // Decoder for [Tag] Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject) -> [Tag] in return Decoders.decode(clazz: [Tag].self, source: source) } // Decoder for Tag Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject) -> Tag in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = Tag() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) return instance } - // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject) -> [User] in return Decoders.decode(clazz: [User].self, source: source) } // Decoder for User Decoders.addDecoder(clazz: User.self) { (source: AnyObject) -> User in - let sourceDictionary = source as! [NSObject:AnyObject] + let sourceDictionary = source as! [NSObject: AnyObject] let instance = User() instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) instance.username = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"]) diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index ea5e47f3cfd4..b3cbea28b69b 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,6 @@ import Foundation - public class Category: JSONEncodable { public var id: Int64? public var name: String? @@ -16,10 +15,10 @@ public class Category: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 90dfd9412255..bb7860b9483f 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,8 @@ import Foundation - public class Order: JSONEncodable { - public enum Status: String { + public enum Status: String { case Placed = "placed" case Approved = "approved" case Delivered = "delivered" @@ -26,14 +25,14 @@ public class Order: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["petId"] = self.petId?.encodeToJSON() nillableDictionary["quantity"] = self.quantity?.encodeToJSON() nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() nillableDictionary["status"] = self.status?.rawValue nillableDictionary["complete"] = self.complete - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index f24e12684e2b..5fa39ec431a4 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,8 @@ import Foundation - public class Pet: JSONEncodable { - public enum Status: String { + public enum Status: String { case Available = "available" case Pending = "pending" case Sold = "sold" @@ -26,14 +25,14 @@ public class Pet: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["category"] = self.category?.encodeToJSON() nillableDictionary["name"] = self.name nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() nillableDictionary["tags"] = self.tags?.encodeToJSON() nillableDictionary["status"] = self.status?.rawValue - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index d79d8df25ec9..df2d12e84fc1 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,6 @@ import Foundation - public class Tag: JSONEncodable { public var id: Int64? public var name: String? @@ -16,10 +15,10 @@ public class Tag: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["name"] = self.name - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift index c4032cd38698..d24a21544177 100644 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,6 @@ import Foundation - public class User: JSONEncodable { public var id: Int64? public var username: String? @@ -23,7 +22,7 @@ public class User: JSONEncodable { // MARK: JSONEncodable func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?]() + var nillableDictionary = [String: AnyObject?]() nillableDictionary["id"] = self.id?.encodeToJSON() nillableDictionary["username"] = self.username nillableDictionary["firstName"] = self.firstName @@ -32,7 +31,7 @@ public class User: JSONEncodable { nillableDictionary["password"] = self.password nillableDictionary["phone"] = self.phone nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] + let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary } } diff --git a/samples/client/petstore/swift/rxswift/git_push.sh b/samples/client/petstore/swift/rxswift/git_push.sh index ced3be2b0c7b..8442b80bb445 100644 --- a/samples/client/petstore/swift/rxswift/git_push.sh +++ b/samples/client/petstore/swift/rxswift/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -34,7 +28,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift3/default/.openapi-generator/VERSION b/samples/client/petstore/swift3/default/.openapi-generator/VERSION index bfbf77eb7fad..6d94c9c2e12a 100644 --- a/samples/client/petstore/swift3/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index e95f9ab1efaf..ea37e8c5966d 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -25,14 +25,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags and operation ID starting with number - - parameter body: (body) client model + - To test special tags + - parameter client: (body) client model - returns: RequestBuilder */ - open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 4fa62a7e183e..e44709f2459f 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -40,11 +40,11 @@ open class FakeAPI: APIBase { } /** - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -53,13 +53,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() + let parameters = outerComposite?.encodeToJSON() let url = URLComponents(string: URLString) @@ -126,75 +126,13 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } - /** - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - - PUT /fake/body-with-file-schema - - For this test, the body for this request much reference a schema named `File`. - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { - let path = "/fake/body-with-file-schema" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter query: (query) - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - - PUT /fake/body-with-query-params - - parameter query: (query) - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { - let path = "/fake/body-with-query-params" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "query": query - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - /** To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -204,13 +142,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) @@ -220,7 +158,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -245,9 +183,9 @@ open class FakeAPI: APIBase { /** - 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 @@ -339,14 +277,6 @@ open class FakeAPI: APIBase { case number2 = -2 } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** * enum for parameter enumFormStringArray */ @@ -364,6 +294,14 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -371,13 +309,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in completion(error) } } @@ -392,17 +330,18 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue + "enum_form_string": enumFormString?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -412,8 +351,7 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -426,88 +364,6 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } - /** - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Fake endpoint to test group parameters (optional) - - DELETE /fake - - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: RequestBuilder - */ - open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), - "int64_group": int64Group?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "required_boolean_group": requiredBooleanGroup, - "boolean_group": booleanGroup - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test inline additionalProperties - - parameter param: (body) request body - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - test inline additionalProperties - - POST /fake/inline-additionalProperties - - parameter param: (body) request body - - returns: RequestBuilder - */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { - let path = "/fake/inline-additionalProperties" - let URLString = PetstoreClientAPI.basePath + path - let parameters = param.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 79a28854094c..20514a3b6e6b 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -12,11 +12,11 @@ import Alamofire open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -29,13 +29,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 495468f63e35..8648214c7309 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } @@ -28,13 +28,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -207,11 +207,11 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } @@ -223,13 +223,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -330,50 +330,4 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } - /** - uploads an image (required) - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - uploads an image (required) - - POST /fake/{petId}/uploadImageWithRequiredFile - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { - var path = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "additionalMetadata": additionalMetadata, - "requiredFile": requiredFile - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - } diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 84cea5213bab..66dbd6f25d8c 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -112,11 +112,11 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -125,13 +125,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = order.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 7abdf0b76cd7..eee28ea249ac 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object + - parameter user: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -26,13 +26,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -43,11 +43,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -56,13 +56,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -73,11 +73,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -86,13 +86,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -137,7 +137,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -150,7 +150,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -236,11 +236,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error) } } @@ -251,16 +251,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 264241b7d139..d1465fe4cbe4 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,15 +297,15 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { - case let .success(value): _result.mapString = value + case let .success(value): _result.mapProperty = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { - case let .success(value): _result.mapMapString = value + case let .success(value): _result.mapOfMapProperty = value case let .failure(error): break } @@ -533,26 +533,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } - // Decoder for [CatAllOf] - Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in - return Decoders.decode(clazz: [CatAllOf].self, source: source) - } - - // Decoder for CatAllOf - Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? CatAllOf() : instance as! CatAllOf - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - - case let .success(value): _result.declawed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) - } - } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -654,26 +634,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } - // Decoder for [DogAllOf] - Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in - return Decoders.decode(clazz: [DogAllOf].self, source: source) - } - - // Decoder for DogAllOf - Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? DogAllOf() : instance as! DogAllOf - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - - case let .success(value): _result.breed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) - } - } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -724,12 +684,6 @@ class Decoders { case let .success(value): _result.enumString = value case let .failure(error): break - } - switch Decoders.decodeOptional(clazz: EnumTest.EnumStringRequired.self, source: sourceDictionary["enum_string_required"] as AnyObject?) { - - case let .success(value): _result.enumStringRequired = value - case let .failure(error): break - } switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { @@ -754,52 +708,6 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } - // Decoder for [File] - Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in - return Decoders.decode(clazz: [File].self, source: source) - } - - // Decoder for File - Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? File() : instance as! File - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { - - case let .success(value): _result.sourceURI = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "File", actual: "\(source)")) - } - } - // Decoder for [FileSchemaTestClass] - Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in - return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) - } - - // Decoder for FileSchemaTestClass - Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? FileSchemaTestClass() : instance as! FileSchemaTestClass - switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { - - case let .success(value): _result.file = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { - - case let .success(value): _result.files = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) - } - } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -958,18 +866,6 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break */ default: break //TODO: handle enum map scenario - } - switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { - - case let .success(value): _result.directMap = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { - - case let .success(value): _result.indirectMap = value - case let .failure(error): break - } return .success(_result) } else { @@ -1326,94 +1222,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } - // Decoder for [TypeHolderDefault] - Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in - return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) - } - - // Decoder for TypeHolderDefault - Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? TypeHolderDefault() : instance as! TypeHolderDefault - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { - - case let .success(value): _result.stringItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { - - case let .success(value): _result.numberItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { - - case let .success(value): _result.integerItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { - - case let .success(value): _result.boolItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { - - case let .success(value): _result.arrayItem = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) - } - } - // Decoder for [TypeHolderExample] - Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in - return Decoders.decode(clazz: [TypeHolderExample].self, source: source) - } - - // Decoder for TypeHolderExample - Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? TypeHolderExample() : instance as! TypeHolderExample - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { - - case let .success(value): _result.stringItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { - - case let .success(value): _result.numberItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { - - case let .success(value): _result.integerItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { - - case let .success(value): _result.boolItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { - - case let .success(value): _result.arrayItem = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) - } - } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 18238c78e35e..48724b45a3d2 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,16 +10,16 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? + public var mapProperty: [String:String]? + public var mapOfMapProperty: [String:[String:String]]? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_string"] = self.mapString?.encodeToJSON() - nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() + nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() + nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 0478bff2d394..59c0660b900d 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,11 +15,6 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } - public enum EnumStringRequired: String { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -29,7 +24,6 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? - public var enumStringRequired: EnumStringRequired? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? @@ -40,7 +34,6 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue - nillableDictionary["enum_string_required"] = self.enumStringRequired?.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index bbc87e81cc75..7b6af62b0576 100644 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,8 +16,6 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? - public var indirectMap: [String:Bool]? public init() {} @@ -25,8 +23,6 @@ open class MapTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario - nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() - nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/default/git_push.sh b/samples/client/petstore/swift3/default/git_push.sh index ced3be2b0c7b..20057f67ade4 100644 --- a/samples/client/petstore/swift3/default/git_push.sh +++ b/samples/client/petstore/swift3/default/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION index bfbf77eb7fad..6d94c9c2e12a 100644 --- a/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index e95f9ab1efaf..ea37e8c5966d 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -25,14 +25,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags and operation ID starting with number - - parameter body: (body) client model + - To test special tags + - parameter client: (body) client model - returns: RequestBuilder */ - open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 4fa62a7e183e..e44709f2459f 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -40,11 +40,11 @@ open class FakeAPI: APIBase { } /** - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -53,13 +53,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() + let parameters = outerComposite?.encodeToJSON() let url = URLComponents(string: URLString) @@ -126,75 +126,13 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } - /** - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - - PUT /fake/body-with-file-schema - - For this test, the body for this request much reference a schema named `File`. - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { - let path = "/fake/body-with-file-schema" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter query: (query) - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - - PUT /fake/body-with-query-params - - parameter query: (query) - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { - let path = "/fake/body-with-query-params" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "query": query - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - /** To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -204,13 +142,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) @@ -220,7 +158,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -245,9 +183,9 @@ open class FakeAPI: APIBase { /** - 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 @@ -339,14 +277,6 @@ open class FakeAPI: APIBase { case number2 = -2 } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** * enum for parameter enumFormStringArray */ @@ -364,6 +294,14 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -371,13 +309,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in completion(error) } } @@ -392,17 +330,18 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue + "enum_form_string": enumFormString?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -412,8 +351,7 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -426,88 +364,6 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } - /** - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Fake endpoint to test group parameters (optional) - - DELETE /fake - - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: RequestBuilder - */ - open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), - "int64_group": int64Group?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "required_boolean_group": requiredBooleanGroup, - "boolean_group": booleanGroup - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test inline additionalProperties - - parameter param: (body) request body - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - test inline additionalProperties - - POST /fake/inline-additionalProperties - - parameter param: (body) request body - - returns: RequestBuilder - */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { - let path = "/fake/inline-additionalProperties" - let URLString = PetstoreClientAPI.basePath + path - let parameters = param.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 79a28854094c..20514a3b6e6b 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -12,11 +12,11 @@ import Alamofire open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -29,13 +29,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 495468f63e35..8648214c7309 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } @@ -28,13 +28,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -207,11 +207,11 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } @@ -223,13 +223,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -330,50 +330,4 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } - /** - uploads an image (required) - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - uploads an image (required) - - POST /fake/{petId}/uploadImageWithRequiredFile - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { - var path = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "additionalMetadata": additionalMetadata, - "requiredFile": requiredFile - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - } diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 84cea5213bab..66dbd6f25d8c 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -112,11 +112,11 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -125,13 +125,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = order.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 7abdf0b76cd7..eee28ea249ac 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object + - parameter user: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -26,13 +26,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -43,11 +43,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -56,13 +56,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -73,11 +73,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -86,13 +86,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -137,7 +137,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -150,7 +150,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -236,11 +236,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error) } } @@ -251,16 +251,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index 264241b7d139..d1465fe4cbe4 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,15 +297,15 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { - case let .success(value): _result.mapString = value + case let .success(value): _result.mapProperty = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { - case let .success(value): _result.mapMapString = value + case let .success(value): _result.mapOfMapProperty = value case let .failure(error): break } @@ -533,26 +533,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } - // Decoder for [CatAllOf] - Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in - return Decoders.decode(clazz: [CatAllOf].self, source: source) - } - - // Decoder for CatAllOf - Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? CatAllOf() : instance as! CatAllOf - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - - case let .success(value): _result.declawed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) - } - } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -654,26 +634,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } - // Decoder for [DogAllOf] - Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in - return Decoders.decode(clazz: [DogAllOf].self, source: source) - } - - // Decoder for DogAllOf - Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? DogAllOf() : instance as! DogAllOf - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - - case let .success(value): _result.breed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) - } - } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -724,12 +684,6 @@ class Decoders { case let .success(value): _result.enumString = value case let .failure(error): break - } - switch Decoders.decodeOptional(clazz: EnumTest.EnumStringRequired.self, source: sourceDictionary["enum_string_required"] as AnyObject?) { - - case let .success(value): _result.enumStringRequired = value - case let .failure(error): break - } switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { @@ -754,52 +708,6 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } - // Decoder for [File] - Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in - return Decoders.decode(clazz: [File].self, source: source) - } - - // Decoder for File - Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? File() : instance as! File - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { - - case let .success(value): _result.sourceURI = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "File", actual: "\(source)")) - } - } - // Decoder for [FileSchemaTestClass] - Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in - return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) - } - - // Decoder for FileSchemaTestClass - Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? FileSchemaTestClass() : instance as! FileSchemaTestClass - switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { - - case let .success(value): _result.file = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { - - case let .success(value): _result.files = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) - } - } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -958,18 +866,6 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break */ default: break //TODO: handle enum map scenario - } - switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { - - case let .success(value): _result.directMap = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { - - case let .success(value): _result.indirectMap = value - case let .failure(error): break - } return .success(_result) } else { @@ -1326,94 +1222,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } - // Decoder for [TypeHolderDefault] - Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in - return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) - } - - // Decoder for TypeHolderDefault - Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? TypeHolderDefault() : instance as! TypeHolderDefault - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { - - case let .success(value): _result.stringItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { - - case let .success(value): _result.numberItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { - - case let .success(value): _result.integerItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { - - case let .success(value): _result.boolItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { - - case let .success(value): _result.arrayItem = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) - } - } - // Decoder for [TypeHolderExample] - Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in - return Decoders.decode(clazz: [TypeHolderExample].self, source: source) - } - - // Decoder for TypeHolderExample - Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? TypeHolderExample() : instance as! TypeHolderExample - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { - - case let .success(value): _result.stringItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { - - case let .success(value): _result.numberItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { - - case let .success(value): _result.integerItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { - - case let .success(value): _result.boolItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { - - case let .success(value): _result.arrayItem = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) - } - } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 18238c78e35e..48724b45a3d2 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,16 +10,16 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? + public var mapProperty: [String:String]? + public var mapOfMapProperty: [String:[String:String]]? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_string"] = self.mapString?.encodeToJSON() - nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() + nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() + nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 0478bff2d394..59c0660b900d 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,11 +15,6 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } - public enum EnumStringRequired: String { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -29,7 +24,6 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? - public var enumStringRequired: EnumStringRequired? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? @@ -40,7 +34,6 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue - nillableDictionary["enum_string_required"] = self.enumStringRequired?.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index b5533babdd4c..099ecb1da5e6 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -29,6 +29,11 @@ open class FormatTest: JSONEncodable { } } public var number: Double? + public var numberNum: NSNumber? { + get { + return number.map({ return NSNumber(value: $0) }) + } + } public var float: Float? public var floatNum: NSNumber? { get { diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index bbc87e81cc75..7b6af62b0576 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,8 +16,6 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? - public var indirectMap: [String:Bool]? public init() {} @@ -25,8 +23,6 @@ open class MapTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario - nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() - nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index bbcf6dc330cd..342d6796d8d9 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -11,6 +11,11 @@ import Foundation open class NumberOnly: JSONEncodable { public var justNumber: Double? + public var justNumberNum: NSNumber? { + get { + return justNumber.map({ return NSNumber(value: $0) }) + } + } public init() {} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 2ffa447b561e..ba3fa230f344 100644 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -11,6 +11,11 @@ import Foundation open class OuterComposite: JSONEncodable { public var myNumber: Double? + public var myNumberNum: NSNumber? { + get { + return myNumber.map({ return NSNumber(value: $0) }) + } + } public var myString: String? public var myBoolean: Bool? public var myBooleanNum: NSNumber? { diff --git a/samples/client/petstore/swift3/objcCompatible/git_push.sh b/samples/client/petstore/swift3/objcCompatible/git_push.sh index ced3be2b0c7b..20057f67ade4 100644 --- a/samples/client/petstore/swift3/objcCompatible/git_push.sh +++ b/samples/client/petstore/swift3/objcCompatible/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION index bfbf77eb7fad..6d94c9c2e12a 100644 --- a/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 9fbe015fba16..1c087005acac 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -13,23 +13,23 @@ import PromiseKit open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test special tags - - parameter body: (body) client model + - parameter client: (body) client model - returns: Promise */ - open class func call123testSpecialTags( body: Client) -> Promise { + open class func testSpecialTags( client: Client) -> Promise { let deferred = Promise.pending() - call123testSpecialTags(body: body) { data, error in + testSpecialTags(client: client) { data, error in if let error = error { deferred.reject(error) } else { @@ -42,14 +42,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags and operation ID starting with number - - parameter body: (body) client model + - To test special tags + - parameter client: (body) client model - returns: RequestBuilder */ - open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 736e2079c38e..d9ab85604de4 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -56,22 +56,22 @@ open class FakeAPI: APIBase { } /** - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in completion(response?.body, error) } } /** - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - returns: Promise */ - open class func fakeOuterCompositeSerialize( body: OuterComposite? = nil) -> Promise { + open class func fakeOuterCompositeSerialize( outerComposite: OuterComposite? = nil) -> Promise { let deferred = Promise.pending() - fakeOuterCompositeSerialize(body: body) { data, error in + fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in if let error = error { deferred.reject(error) } else { @@ -84,13 +84,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() + let parameters = outerComposite?.encodeToJSON() let url = URLComponents(string: URLString) @@ -187,118 +187,25 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } - /** - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error) - } - } - - /** - - parameter body: (body) - - returns: Promise - */ - open class func testBodyWithFileSchema( body: FileSchemaTestClass) -> Promise { - let deferred = Promise.pending() - testBodyWithFileSchema(body: body) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - - PUT /fake/body-with-file-schema - - For this test, the body for this request much reference a schema named `File`. - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { - let path = "/fake/body-with-file-schema" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter query: (query) - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in - completion(error) - } - } - - /** - - parameter query: (query) - - parameter body: (body) - - returns: Promise - */ - open class func testBodyWithQueryParams( query: String, body: User) -> Promise { - let deferred = Promise.pending() - testBodyWithQueryParams(query: query, body: body) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - - PUT /fake/body-with-query-params - - parameter query: (query) - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { - let path = "/fake/body-with-query-params" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "query": query - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - /** To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - returns: Promise */ - open class func testClientModel( body: Client) -> Promise { + open class func testClientModel( client: Client) -> Promise { let deferred = Promise.pending() - testClientModel(body: body) { data, error in + testClientModel(client: client) { data, error in if let error = error { deferred.reject(error) } else { @@ -312,13 +219,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) @@ -328,7 +235,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -352,7 +259,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -382,9 +289,9 @@ open class FakeAPI: APIBase { } /** - 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 @@ -476,14 +383,6 @@ open class FakeAPI: APIBase { case number2 = -2 } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** * enum for parameter enumFormStringArray */ @@ -501,6 +400,14 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -508,13 +415,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in completion(error) } } @@ -526,14 +433,14 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: Promise */ - open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise { + open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> Promise { let deferred = Promise.pending() - testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { error in + testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble) { error in if let error = error { deferred.reject(error) } else { @@ -552,17 +459,18 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue + "enum_form_string": enumFormString?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -572,8 +480,7 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -586,125 +493,6 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } - /** - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: Promise - */ - open class func testGroupParameters( requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Promise { - let deferred = Promise.pending() - testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Fake endpoint to test group parameters (optional) - - DELETE /fake - - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: RequestBuilder - */ - open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), - "int64_group": int64Group?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "required_boolean_group": requiredBooleanGroup, - "boolean_group": booleanGroup - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test inline additionalProperties - - parameter param: (body) request body - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in - completion(error) - } - } - - /** - test inline additionalProperties - - parameter param: (body) request body - - returns: Promise - */ - open class func testInlineAdditionalProperties( param: [String:String]) -> Promise { - let deferred = Promise.pending() - testInlineAdditionalProperties(param: param) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - test inline additionalProperties - - POST /fake/inline-additionalProperties - - parameter param: (body) request body - - returns: RequestBuilder - */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { - let path = "/fake/inline-additionalProperties" - let URLString = PetstoreClientAPI.basePath + path - let parameters = param.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index ca9038656923..7bf28fcfb2c5 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -13,23 +13,23 @@ import PromiseKit open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (body) client model - returns: Promise */ - open class func testClassname( body: Client) -> Promise { + open class func testClassname( client: Client) -> Promise { let deferred = Promise.pending() - testClassname(body: body) { data, error in + testClassname(client: client) { data, error in if let error = error { deferred.reject(error) } else { @@ -46,13 +46,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 2a938c60474e..36338aafb974 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -13,23 +13,23 @@ import PromiseKit open class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: Promise */ - open class func addPet( body: Pet) -> Promise { + open class func addPet( pet: Pet) -> Promise { let deferred = Promise.pending() - addPet(body: body) { error in + addPet(pet: pet) { error in if let error = error { deferred.reject(error) } else { @@ -45,13 +45,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -289,23 +289,23 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: Promise */ - open class func updatePet( body: Pet) -> Promise { + open class func updatePet( pet: Pet) -> Promise { let deferred = Promise.pending() - updatePet(body: body) { error in + updatePet(pet: pet) { error in if let error = error { deferred.reject(error) } else { @@ -321,13 +321,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -464,68 +464,4 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } - /** - uploads an image (required) - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - uploads an image (required) - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: Promise - */ - open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Promise { - let deferred = Promise.pending() - uploadFileWithRequiredFile(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - uploads an image (required) - - POST /fake/{petId}/uploadImageWithRequiredFile - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { - var path = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "additionalMetadata": additionalMetadata, - "requiredFile": requiredFile - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - } diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 7bbc30fa301c..67fe5e9bacf8 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -160,23 +160,23 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(response?.body, error) } } /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - returns: Promise */ - open class func placeOrder( body: Order) -> Promise { + open class func placeOrder( order: Order) -> Promise { let deferred = Promise.pending() - placeOrder(body: body) { data, error in + placeOrder(order: order) { data, error in if let error = error { deferred.reject(error) } else { @@ -189,13 +189,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = order.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index a4b01fb86bed..90a131ebe8b8 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -13,23 +13,23 @@ import PromiseKit open class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object + - parameter user: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } /** Create user - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: Promise */ - open class func createUser( body: User) -> Promise { + open class func createUser( user: User) -> Promise { let deferred = Promise.pending() - createUser(body: body) { error in + createUser(user: user) { error in if let error = error { deferred.reject(error) } else { @@ -43,13 +43,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -60,23 +60,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: Promise */ - open class func createUsersWithArrayInput( body: [User]) -> Promise { + open class func createUsersWithArrayInput( user: [User]) -> Promise { let deferred = Promise.pending() - createUsersWithArrayInput(body: body) { error in + createUsersWithArrayInput(user: user) { error in if let error = error { deferred.reject(error) } else { @@ -89,13 +89,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -106,23 +106,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: Promise */ - open class func createUsersWithListInput( body: [User]) -> Promise { + open class func createUsersWithListInput( user: [User]) -> Promise { let deferred = Promise.pending() - createUsersWithListInput(body: body) { error in + createUsersWithListInput(user: user) { error in if let error = error { deferred.reject(error) } else { @@ -135,13 +135,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -202,7 +202,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -213,7 +213,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: Promise */ open class func getUserByName( username: String) -> Promise { @@ -231,7 +231,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -349,11 +349,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error) } } @@ -361,12 +361,12 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - returns: Promise */ - open class func updateUser( username: String, body: User) -> Promise { + open class func updateUser( username: String, user: User) -> Promise { let deferred = Promise.pending() - updateUser(username: username, body: body) { error in + updateUser(username: username, user: user) { error in if let error = error { deferred.reject(error) } else { @@ -381,16 +381,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift index 264241b7d139..d1465fe4cbe4 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,15 +297,15 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { - case let .success(value): _result.mapString = value + case let .success(value): _result.mapProperty = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { - case let .success(value): _result.mapMapString = value + case let .success(value): _result.mapOfMapProperty = value case let .failure(error): break } @@ -533,26 +533,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } - // Decoder for [CatAllOf] - Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in - return Decoders.decode(clazz: [CatAllOf].self, source: source) - } - - // Decoder for CatAllOf - Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? CatAllOf() : instance as! CatAllOf - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - - case let .success(value): _result.declawed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) - } - } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -654,26 +634,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } - // Decoder for [DogAllOf] - Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in - return Decoders.decode(clazz: [DogAllOf].self, source: source) - } - - // Decoder for DogAllOf - Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? DogAllOf() : instance as! DogAllOf - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - - case let .success(value): _result.breed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) - } - } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -724,12 +684,6 @@ class Decoders { case let .success(value): _result.enumString = value case let .failure(error): break - } - switch Decoders.decodeOptional(clazz: EnumTest.EnumStringRequired.self, source: sourceDictionary["enum_string_required"] as AnyObject?) { - - case let .success(value): _result.enumStringRequired = value - case let .failure(error): break - } switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { @@ -754,52 +708,6 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } - // Decoder for [File] - Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in - return Decoders.decode(clazz: [File].self, source: source) - } - - // Decoder for File - Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? File() : instance as! File - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { - - case let .success(value): _result.sourceURI = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "File", actual: "\(source)")) - } - } - // Decoder for [FileSchemaTestClass] - Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in - return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) - } - - // Decoder for FileSchemaTestClass - Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? FileSchemaTestClass() : instance as! FileSchemaTestClass - switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { - - case let .success(value): _result.file = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { - - case let .success(value): _result.files = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) - } - } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -958,18 +866,6 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break */ default: break //TODO: handle enum map scenario - } - switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { - - case let .success(value): _result.directMap = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { - - case let .success(value): _result.indirectMap = value - case let .failure(error): break - } return .success(_result) } else { @@ -1326,94 +1222,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } - // Decoder for [TypeHolderDefault] - Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in - return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) - } - - // Decoder for TypeHolderDefault - Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? TypeHolderDefault() : instance as! TypeHolderDefault - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { - - case let .success(value): _result.stringItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { - - case let .success(value): _result.numberItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { - - case let .success(value): _result.integerItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { - - case let .success(value): _result.boolItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { - - case let .success(value): _result.arrayItem = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) - } - } - // Decoder for [TypeHolderExample] - Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in - return Decoders.decode(clazz: [TypeHolderExample].self, source: source) - } - - // Decoder for TypeHolderExample - Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? TypeHolderExample() : instance as! TypeHolderExample - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { - - case let .success(value): _result.stringItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { - - case let .success(value): _result.numberItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { - - case let .success(value): _result.integerItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { - - case let .success(value): _result.boolItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { - - case let .success(value): _result.arrayItem = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) - } - } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 18238c78e35e..48724b45a3d2 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,16 +10,16 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? + public var mapProperty: [String:String]? + public var mapOfMapProperty: [String:[String:String]]? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_string"] = self.mapString?.encodeToJSON() - nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() + nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() + nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 0478bff2d394..59c0660b900d 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,11 +15,6 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } - public enum EnumStringRequired: String { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -29,7 +24,6 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? - public var enumStringRequired: EnumStringRequired? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? @@ -40,7 +34,6 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue - nillableDictionary["enum_string_required"] = self.enumStringRequired?.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index bbc87e81cc75..7b6af62b0576 100644 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,8 +16,6 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? - public var indirectMap: [String:Bool]? public init() {} @@ -25,8 +23,6 @@ open class MapTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario - nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() - nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/promisekit/git_push.sh b/samples/client/petstore/swift3/promisekit/git_push.sh index ced3be2b0c7b..20057f67ade4 100644 --- a/samples/client/petstore/swift3/promisekit/git_push.sh +++ b/samples/client/petstore/swift3/promisekit/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION index bfbf77eb7fad..6d94c9c2e12a 100644 --- a/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index be4174fd49bb..c468f8a38288 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -13,23 +13,23 @@ import RxSwift open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test special tags - - parameter body: (body) client model + - parameter client: (body) client model - returns: Observable */ - open class func call123testSpecialTags(body: Client) -> Observable { + open class func testSpecialTags(client: Client) -> Observable { return Observable.create { observer -> Disposable in - call123testSpecialTags(body: body) { data, error in + testSpecialTags(client: client) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -44,14 +44,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags and operation ID starting with number - - parameter body: (body) client model + - To test special tags + - parameter client: (body) client model - returns: RequestBuilder */ - open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 39a4d8062cce..9197924fff87 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -58,22 +58,22 @@ open class FakeAPI: APIBase { } /** - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in completion(response?.body, error) } } /** - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - returns: Observable */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil) -> Observable { + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil) -> Observable { return Observable.create { observer -> Disposable in - fakeOuterCompositeSerialize(body: body) { data, error in + fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -88,13 +88,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() + let parameters = outerComposite?.encodeToJSON() let url = URLComponents(string: URLString) @@ -195,122 +195,25 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } - /** - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error) - } - } - - /** - - parameter body: (body) - - returns: Observable - */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass) -> Observable { - return Observable.create { observer -> Disposable in - testBodyWithFileSchema(body: body) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - - PUT /fake/body-with-file-schema - - For this test, the body for this request much reference a schema named `File`. - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { - let path = "/fake/body-with-file-schema" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter query: (query) - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in - completion(error) - } - } - - /** - - parameter query: (query) - - parameter body: (body) - - returns: Observable - */ - open class func testBodyWithQueryParams(query: String, body: User) -> Observable { - return Observable.create { observer -> Disposable in - testBodyWithQueryParams(query: query, body: body) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - - PUT /fake/body-with-query-params - - parameter query: (query) - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { - let path = "/fake/body-with-query-params" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "query": query - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - /** To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - returns: Observable */ - open class func testClientModel(body: Client) -> Observable { + open class func testClientModel(client: Client) -> Observable { return Observable.create { observer -> Disposable in - testClientModel(body: body) { data, error in + testClientModel(client: client) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -326,13 +229,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) @@ -342,7 +245,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -366,7 +269,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -398,9 +301,9 @@ open class FakeAPI: APIBase { } /** - 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 @@ -492,14 +395,6 @@ open class FakeAPI: APIBase { case number2 = -2 } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** * enum for parameter enumFormStringArray */ @@ -517,6 +412,14 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -524,13 +427,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in completion(error) } } @@ -542,14 +445,14 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: Observable */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Observable { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> Observable { return Observable.create { observer -> Disposable in - testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { error in + testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -570,17 +473,18 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue + "enum_form_string": enumFormString?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -590,8 +494,7 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -604,129 +507,6 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } - /** - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: Observable - */ - open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Observable { - return Observable.create { observer -> Disposable in - testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Fake endpoint to test group parameters (optional) - - DELETE /fake - - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: RequestBuilder - */ - open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), - "int64_group": int64Group?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "required_boolean_group": requiredBooleanGroup, - "boolean_group": booleanGroup - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test inline additionalProperties - - parameter param: (body) request body - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in - completion(error) - } - } - - /** - test inline additionalProperties - - parameter param: (body) request body - - returns: Observable - */ - open class func testInlineAdditionalProperties(param: [String:String]) -> Observable { - return Observable.create { observer -> Disposable in - testInlineAdditionalProperties(param: param) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - test inline additionalProperties - - POST /fake/inline-additionalProperties - - parameter param: (body) request body - - returns: RequestBuilder - */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { - let path = "/fake/inline-additionalProperties" - let URLString = PetstoreClientAPI.basePath + path - let parameters = param.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 80fd6e47fd53..d2a6ecf21977 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -13,23 +13,23 @@ import RxSwift open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (body) client model - returns: Observable */ - open class func testClassname(body: Client) -> Observable { + open class func testClassname(client: Client) -> Observable { return Observable.create { observer -> Disposable in - testClassname(body: body) { data, error in + testClassname(client: client) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -48,13 +48,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 964c1ea0c06d..0cb25ffcbdb4 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -13,23 +13,23 @@ import RxSwift open class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: Observable */ - open class func addPet(body: Pet) -> Observable { + open class func addPet(pet: Pet) -> Observable { return Observable.create { observer -> Disposable in - addPet(body: body) { error in + addPet(pet: pet) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -47,13 +47,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -299,23 +299,23 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: Observable */ - open class func updatePet(body: Pet) -> Observable { + open class func updatePet(pet: Pet) -> Observable { return Observable.create { observer -> Disposable in - updatePet(body: body) { error in + updatePet(pet: pet) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -333,13 +333,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -480,70 +480,4 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } - /** - uploads an image (required) - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - uploads an image (required) - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: Observable - */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - uploadFileWithRequiredFile(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - uploads an image (required) - - POST /fake/{petId}/uploadImageWithRequiredFile - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { - var path = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "additionalMetadata": additionalMetadata, - "requiredFile": requiredFile - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - } diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 752f516020fd..1fc9de36c091 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -166,23 +166,23 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(response?.body, error) } } /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - returns: Observable */ - open class func placeOrder(body: Order) -> Observable { + open class func placeOrder(order: Order) -> Observable { return Observable.create { observer -> Disposable in - placeOrder(body: body) { data, error in + placeOrder(order: order) { data, error in if let error = error { observer.on(.error(error as Error)) } else { @@ -197,13 +197,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = order.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 8f69dfd4a4f9..0641d7201db4 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -13,23 +13,23 @@ import RxSwift open class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object + - parameter user: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } /** Create user - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: Observable */ - open class func createUser(body: User) -> Observable { + open class func createUser(user: User) -> Observable { return Observable.create { observer -> Disposable in - createUser(body: body) { error in + createUser(user: user) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -45,13 +45,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -62,23 +62,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: Observable */ - open class func createUsersWithArrayInput(body: [User]) -> Observable { + open class func createUsersWithArrayInput(user: [User]) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithArrayInput(body: body) { error in + createUsersWithArrayInput(user: user) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -93,13 +93,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -110,23 +110,23 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: Observable */ - open class func createUsersWithListInput(body: [User]) -> Observable { + open class func createUsersWithListInput(user: [User]) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithListInput(body: body) { error in + createUsersWithListInput(user: user) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -141,13 +141,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -210,7 +210,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -221,7 +221,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: Observable */ open class func getUserByName(username: String) -> Observable { @@ -241,7 +241,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -363,11 +363,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error) } } @@ -375,12 +375,12 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - returns: Observable */ - open class func updateUser(username: String, body: User) -> Observable { + open class func updateUser(username: String, user: User) -> Observable { return Observable.create { observer -> Disposable in - updateUser(username: username, body: body) { error in + updateUser(username: username, user: user) { error in if let error = error { observer.on(.error(error as Error)) } else { @@ -397,16 +397,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift index 264241b7d139..d1465fe4cbe4 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,15 +297,15 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { - case let .success(value): _result.mapString = value + case let .success(value): _result.mapProperty = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { - case let .success(value): _result.mapMapString = value + case let .success(value): _result.mapOfMapProperty = value case let .failure(error): break } @@ -533,26 +533,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } - // Decoder for [CatAllOf] - Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in - return Decoders.decode(clazz: [CatAllOf].self, source: source) - } - - // Decoder for CatAllOf - Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? CatAllOf() : instance as! CatAllOf - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - - case let .success(value): _result.declawed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) - } - } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -654,26 +634,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } - // Decoder for [DogAllOf] - Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in - return Decoders.decode(clazz: [DogAllOf].self, source: source) - } - - // Decoder for DogAllOf - Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? DogAllOf() : instance as! DogAllOf - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - - case let .success(value): _result.breed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) - } - } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -724,12 +684,6 @@ class Decoders { case let .success(value): _result.enumString = value case let .failure(error): break - } - switch Decoders.decodeOptional(clazz: EnumTest.EnumStringRequired.self, source: sourceDictionary["enum_string_required"] as AnyObject?) { - - case let .success(value): _result.enumStringRequired = value - case let .failure(error): break - } switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { @@ -754,52 +708,6 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } - // Decoder for [File] - Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in - return Decoders.decode(clazz: [File].self, source: source) - } - - // Decoder for File - Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? File() : instance as! File - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { - - case let .success(value): _result.sourceURI = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "File", actual: "\(source)")) - } - } - // Decoder for [FileSchemaTestClass] - Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in - return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) - } - - // Decoder for FileSchemaTestClass - Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? FileSchemaTestClass() : instance as! FileSchemaTestClass - switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { - - case let .success(value): _result.file = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { - - case let .success(value): _result.files = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) - } - } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -958,18 +866,6 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break */ default: break //TODO: handle enum map scenario - } - switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { - - case let .success(value): _result.directMap = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { - - case let .success(value): _result.indirectMap = value - case let .failure(error): break - } return .success(_result) } else { @@ -1326,94 +1222,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } - // Decoder for [TypeHolderDefault] - Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in - return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) - } - - // Decoder for TypeHolderDefault - Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? TypeHolderDefault() : instance as! TypeHolderDefault - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { - - case let .success(value): _result.stringItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { - - case let .success(value): _result.numberItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { - - case let .success(value): _result.integerItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { - - case let .success(value): _result.boolItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { - - case let .success(value): _result.arrayItem = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) - } - } - // Decoder for [TypeHolderExample] - Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in - return Decoders.decode(clazz: [TypeHolderExample].self, source: source) - } - - // Decoder for TypeHolderExample - Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? TypeHolderExample() : instance as! TypeHolderExample - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string_item"] as AnyObject?) { - - case let .success(value): _result.stringItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number_item"] as AnyObject?) { - - case let .success(value): _result.numberItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer_item"] as AnyObject?) { - - case let .success(value): _result.integerItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["bool_item"] as AnyObject?) { - - case let .success(value): _result.boolItem = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [Int32].self, source: sourceDictionary["array_item"] as AnyObject?) { - - case let .success(value): _result.arrayItem = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) - } - } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 18238c78e35e..48724b45a3d2 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,16 +10,16 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? + public var mapProperty: [String:String]? + public var mapOfMapProperty: [String:[String:String]]? public init() {} // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_string"] = self.mapString?.encodeToJSON() - nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() + nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() + nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 0478bff2d394..59c0660b900d 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,11 +15,6 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } - public enum EnumStringRequired: String { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -29,7 +24,6 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? - public var enumStringRequired: EnumStringRequired? public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? @@ -40,7 +34,6 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue - nillableDictionary["enum_string_required"] = self.enumStringRequired?.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index bbc87e81cc75..7b6af62b0576 100644 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,8 +16,6 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? - public var indirectMap: [String:Bool]? public init() {} @@ -25,8 +23,6 @@ open class MapTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario - nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() - nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/rxswift/git_push.sh b/samples/client/petstore/swift3/rxswift/git_push.sh index ced3be2b0c7b..20057f67ade4 100644 --- a/samples/client/petstore/swift3/rxswift/git_push.sh +++ b/samples/client/petstore/swift3/rxswift/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION b/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION index bfbf77eb7fad..6d94c9c2e12a 100644 --- a/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION +++ b/samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index e95f9ab1efaf..ea37e8c5966d 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class AnotherFakeAPI: APIBase { /** To test special tags - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -25,14 +25,14 @@ open class AnotherFakeAPI: APIBase { /** To test special tags - PATCH /another-fake/dummy - - To test special tags and operation ID starting with number - - parameter body: (body) client model + - To test special tags + - parameter client: (body) client model - returns: RequestBuilder */ - open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/another-fake/dummy" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 4fa62a7e183e..e44709f2459f 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -40,11 +40,11 @@ open class FakeAPI: APIBase { } /** - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -53,13 +53,13 @@ open class FakeAPI: APIBase { /** - POST /fake/outer/composite - Test serialization of object with outer number type - - parameter body: (body) Input composite as post body (optional) + - parameter outerComposite: (body) Input composite as post body (optional) - returns: RequestBuilder */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { let path = "/fake/outer/composite" let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() + let parameters = outerComposite?.encodeToJSON() let url = URLComponents(string: URLString) @@ -126,75 +126,13 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) } - /** - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - - PUT /fake/body-with-file-schema - - For this test, the body for this request much reference a schema named `File`. - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { - let path = "/fake/body-with-file-schema" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter query: (query) - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - - PUT /fake/body-with-query-params - - parameter query: (query) - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { - let path = "/fake/body-with-query-params" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "query": query - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - /** To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -204,13 +142,13 @@ open class FakeAPI: APIBase { To test \"client\" model - PATCH /fake - To test \"client\" model - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) @@ -220,7 +158,7 @@ open class FakeAPI: APIBase { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None - parameter patternWithoutDelimiter: (form) None @@ -245,9 +183,9 @@ open class FakeAPI: APIBase { /** - 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 @@ -339,14 +277,6 @@ open class FakeAPI: APIBase { case number2 = -2 } - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - /** * enum for parameter enumFormStringArray */ @@ -364,6 +294,14 @@ open class FakeAPI: APIBase { case xyz = "(xyz)" } + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + /** To test enum parameters - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) @@ -371,13 +309,13 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in completion(error) } } @@ -392,17 +330,18 @@ open class FakeAPI: APIBase { - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - parameter enumFormString: (form) Form parameter enum test (string) (optional) + - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - returns: RequestBuilder */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue + "enum_form_string": enumFormString?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue ] let nonNullParameters = APIHelper.rejectNil(formParams) @@ -412,8 +351,7 @@ open class FakeAPI: APIBase { url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ "enum_query_string_array": enumQueryStringArray, "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue + "enum_query_integer": enumQueryInteger?.rawValue ]) let nillableHeaders: [String: Any?] = [ "enum_header_string_array": enumHeaderStringArray, @@ -426,88 +364,6 @@ open class FakeAPI: APIBase { return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) } - /** - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testGroupParameters(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Fake endpoint to test group parameters (optional) - - DELETE /fake - - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: RequestBuilder - */ - open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int32, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int32? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), - "int64_group": int64Group?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "required_boolean_group": requiredBooleanGroup, - "boolean_group": booleanGroup - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test inline additionalProperties - - parameter param: (body) request body - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - test inline additionalProperties - - POST /fake/inline-additionalProperties - - parameter param: (body) request body - - returns: RequestBuilder - */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { - let path = "/fake/inline-additionalProperties" - let URLString = PetstoreClientAPI.basePath + path - let parameters = param.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - /** test json serialization of form data - parameter param: (form) field1 diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 79a28854094c..20514a3b6e6b 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -12,11 +12,11 @@ import Alamofire open class FakeClassnameTags123API: APIBase { /** To test class name in snake case - - parameter body: (body) client model + - parameter client: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -29,13 +29,13 @@ open class FakeClassnameTags123API: APIBase { - API Key: - type: apiKey api_key_query (QUERY) - name: api_key_query - - parameter body: (body) client model + - parameter client: (body) client model - returns: RequestBuilder */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { let path = "/fake_classname_test" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = client.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 495468f63e35..8648214c7309 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class PetAPI: APIBase { /** Add a new pet to the store - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } @@ -28,13 +28,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -207,11 +207,11 @@ open class PetAPI: APIBase { /** Update an existing pet - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in completion(error) } } @@ -223,13 +223,13 @@ open class PetAPI: APIBase { - OAuth: - type: oauth2 - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store + - parameter pet: (body) Pet object that needs to be added to the store - returns: RequestBuilder */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { let path = "/pet" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = pet.encodeToJSON() let url = URLComponents(string: URLString) @@ -330,50 +330,4 @@ open class PetAPI: APIBase { return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } - /** - uploads an image (required) - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - uploads an image (required) - - POST /fake/{petId}/uploadImageWithRequiredFile - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { - var path = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "additionalMetadata": additionalMetadata, - "requiredFile": requiredFile - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - } diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 84cea5213bab..66dbd6f25d8c 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -112,11 +112,11 @@ open class StoreAPI: APIBase { /** Place an order for a pet - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in completion(response?.body, error) } } @@ -125,13 +125,13 @@ open class StoreAPI: APIBase { /** Place an order for a pet - POST /store/order - - parameter body: (body) order placed for purchasing the pet + - parameter order: (body) order placed for purchasing the pet - returns: RequestBuilder */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { let path = "/store/order" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = order.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 7abdf0b76cd7..eee28ea249ac 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -12,11 +12,11 @@ import Alamofire open class UserAPI: APIBase { /** Create user - - parameter body: (body) Created user object + - parameter user: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -26,13 +26,13 @@ open class UserAPI: APIBase { Create user - POST /user - This can only be done by the logged in user. - - parameter body: (body) Created user object + - parameter user: (body) Created user object - returns: RequestBuilder */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { let path = "/user" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -43,11 +43,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -56,13 +56,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithArray - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithArray" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -73,11 +73,11 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - - parameter body: (body) List of user object + - parameter user: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in completion(error) } } @@ -86,13 +86,13 @@ open class UserAPI: APIBase { /** Creates list of users with given input array - POST /user/createWithList - - parameter body: (body) List of user object + - parameter user: (body) List of user object - returns: RequestBuilder */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { let path = "/user/createWithList" let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) @@ -137,7 +137,7 @@ open class UserAPI: APIBase { /** Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { @@ -150,7 +150,7 @@ open class UserAPI: APIBase { /** Get user by user name - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - returns: RequestBuilder */ open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { @@ -236,11 +236,11 @@ open class UserAPI: APIBase { /** Updated user - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in completion(error) } } @@ -251,16 +251,16 @@ open class UserAPI: APIBase { - PUT /user/{username} - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object + - parameter user: (body) Updated user object - returns: RequestBuilder */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { var path = "/user/{username}" let usernamePreEscape = "\(username)" let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters = body.encodeToJSON() + let parameters = user.encodeToJSON() let url = URLComponents(string: URLString) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift index a9eba8b46f3a..ae32e6fab12c 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -297,12 +297,12 @@ class Decoders { Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { let _result = AdditionalPropertiesClass() - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_string"] as AnyObject?) { - case let .success(value): _result.mapString = value + switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { + case let .success(value): _result.mapProperty = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_string"] as AnyObject?) { - case let .success(value): _result.mapMapString = value + switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { + case let .success(value): _result.mapOfMapProperty = value case let .failure(error): break } return .success(_result) @@ -492,24 +492,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) } } - // Decoder for [CatAllOf] - Decoders.addDecoder(clazz: [CatAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[CatAllOf]> in - return Decoders.decode(clazz: [CatAllOf].self, source: source) - } - - // Decoder for CatAllOf - Decoders.addDecoder(clazz: CatAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = CatAllOf() - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - case let .success(value): _result.declawed = value - case let .failure(error): break - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "CatAllOf", actual: "\(source)")) - } - } // Decoder for [Category] Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in return Decoders.decode(clazz: [Category].self, source: source) @@ -518,17 +500,15 @@ class Decoders { // Decoder for Category Decoders.addDecoder(clazz: Category.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { - guard let nameSource = sourceDictionary["name"] as AnyObject? else { - return .failure(.missingKey(key: "name")) - } - guard let name = Decoders.decode(clazz: String.self.self, source: nameSource).value else { - return .failure(.typeMismatch(expected: "Category", actual: "\(nameSource)")) - } - let _result = Category(name: name) + let _result = Category() switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { case let .success(value): _result.id = value case let .failure(error): break } + switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { + case let .success(value): _result.name = value + case let .failure(error): break + } return .success(_result) } else { return .failure(.typeMismatch(expected: "Category", actual: "\(source)")) @@ -598,24 +578,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) } } - // Decoder for [DogAllOf] - Decoders.addDecoder(clazz: [DogAllOf].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[DogAllOf]> in - return Decoders.decode(clazz: [DogAllOf].self, source: source) - } - - // Decoder for DogAllOf - Decoders.addDecoder(clazz: DogAllOf.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = DogAllOf() - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - case let .success(value): _result.breed = value - case let .failure(error): break - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "DogAllOf", actual: "\(source)")) - } - } // Decoder for [EnumArrays] Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in return Decoders.decode(clazz: [EnumArrays].self, source: source) @@ -656,13 +618,7 @@ class Decoders { // Decoder for EnumTest Decoders.addDecoder(clazz: EnumTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in if let sourceDictionary = source as? [AnyHashable: Any] { - guard let enumStringRequiredSource = sourceDictionary["enum_string_required"] as AnyObject? else { - return .failure(.missingKey(key: "enum_string_required")) - } - guard let enumStringRequired = Decoders.decode(clazz: EnumTest.EnumStringRequired.self.self, source: enumStringRequiredSource).value else { - return .failure(.typeMismatch(expected: "EnumTest", actual: "\(enumStringRequiredSource)")) - } - let _result = EnumTest(enumStringRequired: enumStringRequired) + let _result = EnumTest() switch Decoders.decodeOptional(clazz: EnumTest.EnumString.self, source: sourceDictionary["enum_string"] as AnyObject?) { case let .success(value): _result.enumString = value case let .failure(error): break @@ -684,46 +640,6 @@ class Decoders { return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) } } - // Decoder for [File] - Decoders.addDecoder(clazz: [File].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[File]> in - return Decoders.decode(clazz: [File].self, source: source) - } - - // Decoder for File - Decoders.addDecoder(clazz: File.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = File() - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["sourceURI"] as AnyObject?) { - case let .success(value): _result.sourceURI = value - case let .failure(error): break - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "File", actual: "\(source)")) - } - } - // Decoder for [FileSchemaTestClass] - Decoders.addDecoder(clazz: [FileSchemaTestClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FileSchemaTestClass]> in - return Decoders.decode(clazz: [FileSchemaTestClass].self, source: source) - } - - // Decoder for FileSchemaTestClass - Decoders.addDecoder(clazz: FileSchemaTestClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = FileSchemaTestClass() - switch Decoders.decodeOptional(clazz: File.self, source: sourceDictionary["file"] as AnyObject?) { - case let .success(value): _result.file = value - case let .failure(error): break - } - switch Decoders.decodeOptional(clazz: [File].self, source: sourceDictionary["files"] as AnyObject?) { - case let .success(value): _result.files = value - case let .failure(error): break - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "FileSchemaTestClass", actual: "\(source)")) - } - } // Decoder for [FormatTest] Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in return Decoders.decode(clazz: [FormatTest].self, source: source) @@ -855,14 +771,6 @@ class Decoders { case let .success(value): _result.mapOfEnumString = value case let .failure(error): break } - switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["direct_map"] as AnyObject?) { - case let .success(value): _result.directMap = value - case let .failure(error): break - } - switch Decoders.decodeOptional(clazz: [String:Bool].self, source: sourceDictionary["indirect_map"] as AnyObject?) { - case let .success(value): _result.indirectMap = value - case let .failure(error): break - } return .success(_result) } else { return .failure(.typeMismatch(expected: "MapTest", actual: "\(source)")) @@ -1162,94 +1070,6 @@ class Decoders { return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) } } - // Decoder for [TypeHolderDefault] - Decoders.addDecoder(clazz: [TypeHolderDefault].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderDefault]> in - return Decoders.decode(clazz: [TypeHolderDefault].self, source: source) - } - - // Decoder for TypeHolderDefault - Decoders.addDecoder(clazz: TypeHolderDefault.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - guard let stringItemSource = sourceDictionary["string_item"] as AnyObject? else { - return .failure(.missingKey(key: "string_item")) - } - guard let stringItem = Decoders.decode(clazz: String.self.self, source: stringItemSource).value else { - return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(stringItemSource)")) - } - guard let numberItemSource = sourceDictionary["number_item"] as AnyObject? else { - return .failure(.missingKey(key: "number_item")) - } - guard let numberItem = Decoders.decode(clazz: Double.self.self, source: numberItemSource).value else { - return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(numberItemSource)")) - } - guard let integerItemSource = sourceDictionary["integer_item"] as AnyObject? else { - return .failure(.missingKey(key: "integer_item")) - } - guard let integerItem = Decoders.decode(clazz: Int32.self.self, source: integerItemSource).value else { - return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(integerItemSource)")) - } - guard let boolItemSource = sourceDictionary["bool_item"] as AnyObject? else { - return .failure(.missingKey(key: "bool_item")) - } - guard let boolItem = Decoders.decode(clazz: Bool.self.self, source: boolItemSource).value else { - return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(boolItemSource)")) - } - guard let arrayItemSource = sourceDictionary["array_item"] as AnyObject? else { - return .failure(.missingKey(key: "array_item")) - } - guard let arrayItem = Decoders.decode(clazz: [Int32].self.self, source: arrayItemSource).value else { - return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(arrayItemSource)")) - } - let _result = TypeHolderDefault(stringItem: stringItem, numberItem: numberItem, integerItem: integerItem, boolItem: boolItem, arrayItem: arrayItem) - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "TypeHolderDefault", actual: "\(source)")) - } - } - // Decoder for [TypeHolderExample] - Decoders.addDecoder(clazz: [TypeHolderExample].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[TypeHolderExample]> in - return Decoders.decode(clazz: [TypeHolderExample].self, source: source) - } - - // Decoder for TypeHolderExample - Decoders.addDecoder(clazz: TypeHolderExample.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - guard let stringItemSource = sourceDictionary["string_item"] as AnyObject? else { - return .failure(.missingKey(key: "string_item")) - } - guard let stringItem = Decoders.decode(clazz: String.self.self, source: stringItemSource).value else { - return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(stringItemSource)")) - } - guard let numberItemSource = sourceDictionary["number_item"] as AnyObject? else { - return .failure(.missingKey(key: "number_item")) - } - guard let numberItem = Decoders.decode(clazz: Double.self.self, source: numberItemSource).value else { - return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(numberItemSource)")) - } - guard let integerItemSource = sourceDictionary["integer_item"] as AnyObject? else { - return .failure(.missingKey(key: "integer_item")) - } - guard let integerItem = Decoders.decode(clazz: Int32.self.self, source: integerItemSource).value else { - return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(integerItemSource)")) - } - guard let boolItemSource = sourceDictionary["bool_item"] as AnyObject? else { - return .failure(.missingKey(key: "bool_item")) - } - guard let boolItem = Decoders.decode(clazz: Bool.self.self, source: boolItemSource).value else { - return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(boolItemSource)")) - } - guard let arrayItemSource = sourceDictionary["array_item"] as AnyObject? else { - return .failure(.missingKey(key: "array_item")) - } - guard let arrayItem = Decoders.decode(clazz: [Int32].self.self, source: arrayItemSource).value else { - return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(arrayItemSource)")) - } - let _result = TypeHolderExample(stringItem: stringItem, numberItem: numberItem, integerItem: integerItem, boolItem: boolItem, arrayItem: arrayItem) - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "TypeHolderExample", actual: "\(source)")) - } - } // Decoder for [User] Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in return Decoders.decode(clazz: [User].self, source: source) diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index dc74e77f88cd..c36f0571b306 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -10,19 +10,19 @@ import Foundation open class AdditionalPropertiesClass: JSONEncodable { - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? + public var mapProperty: [String:String]? + public var mapOfMapProperty: [String:[String:String]]? - public init(mapString: [String:String]?=nil, mapMapString: [String:[String:String]]?=nil) { - self.mapString = mapString - self.mapMapString = mapMapString + public init(mapProperty: [String:String]?=nil, mapOfMapProperty: [String:[String:String]]?=nil) { + self.mapProperty = mapProperty + self.mapOfMapProperty = mapOfMapProperty } // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() - nillableDictionary["map_string"] = self.mapString?.encodeToJSON() - nillableDictionary["map_map_string"] = self.mapMapString?.encodeToJSON() + nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() + nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 69cd8cd074e3..61d01b5e094f 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -11,10 +11,10 @@ import Foundation open class Category: JSONEncodable { public var id: Int64? - public var name: String + public var name: String? - public init(id: Int64?=nil, name: String) { + public init(id: Int64?=nil, name: String?=nil) { self.id = id self.name = name } diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 57865687dd68..896b7d33b20a 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -15,11 +15,6 @@ open class EnumTest: JSONEncodable { case lower = "lower" case empty = "" } - public enum EnumStringRequired: String { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } public enum EnumInteger: Int32 { case _1 = 1 case number1 = -1 @@ -29,15 +24,13 @@ open class EnumTest: JSONEncodable { case number12 = -1.2 } public var enumString: EnumString? - public var enumStringRequired: EnumStringRequired public var enumInteger: EnumInteger? public var enumNumber: EnumNumber? public var outerEnum: OuterEnum? - public init(enumString: EnumString?=nil, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?=nil, enumNumber: EnumNumber?=nil, outerEnum: OuterEnum?=nil) { + public init(enumString: EnumString?=nil, enumInteger: EnumInteger?=nil, enumNumber: EnumNumber?=nil, outerEnum: OuterEnum?=nil) { self.enumString = enumString - self.enumStringRequired = enumStringRequired self.enumInteger = enumInteger self.enumNumber = enumNumber self.outerEnum = outerEnum @@ -46,7 +39,6 @@ open class EnumTest: JSONEncodable { open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["enum_string"] = self.enumString?.rawValue - nillableDictionary["enum_string_required"] = self.enumStringRequired.rawValue nillableDictionary["enum_integer"] = self.enumInteger?.rawValue nillableDictionary["enum_number"] = self.enumNumber?.rawValue nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() diff --git a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index b5f10f5061bc..b1f04aad6ce7 100644 --- a/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -16,22 +16,16 @@ open class MapTest: JSONEncodable { } public var mapMapOfString: [String:[String:String]]? public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? - public var indirectMap: [String:Bool]? - public init(mapMapOfString: [String:[String:String]]?=nil, mapOfEnumString: [String:String]?=nil, directMap: [String:Bool]?=nil, indirectMap: [String:Bool]?=nil) { + public init(mapMapOfString: [String:[String:String]]?=nil, mapOfEnumString: [String:String]?=nil) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString - self.directMap = directMap - self.indirectMap = indirectMap } // MARK: JSONEncodable open func encodeToJSON() -> Any { var nillableDictionary = [String:Any?]() nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario - nillableDictionary["direct_map"] = self.directMap?.encodeToJSON() - nillableDictionary["indirect_map"] = self.indirectMap?.encodeToJSON() let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] return dictionary diff --git a/samples/client/petstore/swift3/unwraprequired/git_push.sh b/samples/client/petstore/swift3/unwraprequired/git_push.sh index ced3be2b0c7b..20057f67ade4 100644 --- a/samples/client/petstore/swift3/unwraprequired/git_push.sh +++ b/samples/client/petstore/swift3/unwraprequired/git_push.sh @@ -1,17 +1,11 @@ #!/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" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 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" @@ -43,9 +37,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git fi fi @@ -53,6 +47,6 @@ 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" +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/swift4/default/Package.swift b/samples/client/petstore/swift4/default/Package.swift index a847bc5077d1..e5c5f0f33b82 100644 --- a/samples/client/petstore/swift4/default/Package.swift +++ b/samples/client/petstore/swift4/default/Package.swift @@ -9,11 +9,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -22,6 +22,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire"], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index 13586cdadd87..832282d224f8 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 1e6b7fc02c2c..02e24286e3c8 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class AnotherFakeAPI { /** To test special tags @@ -16,7 +14,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index d04aec357766..8f5d7550f0c8 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,15 +7,13 @@ import Foundation - - open class FakeAPI { /** - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -44,7 +42,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -73,7 +71,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -102,7 +100,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -131,8 +129,8 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -165,8 +163,8 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -202,7 +200,7 @@ open class FakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -246,8 +244,8 @@ open class FakeAPI { - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - 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)) { - testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in + 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)) { + testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -282,7 +280,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -301,7 +299,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -389,8 +387,8 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -416,19 +414,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -453,8 +451,8 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -478,13 +476,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -504,8 +502,8 @@ open class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -520,7 +518,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -539,8 +537,8 @@ open class FakeAPI { - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -559,14 +557,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 822a371cef34..060d434fbf24 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,8 +7,6 @@ import Foundation - - open class FakeClassnameTags123API { /** To test class name in snake case @@ -16,7 +14,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index cc4397947d1d..fe75962a72cf 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class PetAPI { /** Add a new pet to the store @@ -16,8 +14,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -54,8 +52,8 @@ open class PetAPI { - parameter apiKey: (header) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -80,8 +78,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -108,7 +106,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -127,8 +125,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -145,7 +143,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -164,8 +162,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -182,7 +180,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -204,8 +202,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -219,8 +217,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -258,8 +256,8 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -285,14 +283,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -308,7 +306,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -331,14 +329,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -354,7 +352,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in completion(response?.body, error) } @@ -377,14 +375,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index b62f18f3f020..d5f627df52ac 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class StoreAPI { /** Delete purchase order by ID @@ -16,8 +14,8 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -39,8 +37,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -53,7 +51,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -68,14 +66,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -86,7 +84,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -105,8 +103,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -120,7 +118,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 0e2d140e037d..ef4f971a91e2 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class UserAPI { /** Create user @@ -16,8 +14,8 @@ open class UserAPI { - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -51,8 +49,8 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -85,8 +83,8 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -119,8 +117,8 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -142,8 +140,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -157,7 +155,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -175,8 +173,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -191,7 +189,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -208,11 +206,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -226,8 +224,8 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in + open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -244,8 +242,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -260,8 +258,8 @@ open class UserAPI { - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index f8521a9c036e..1d54e695608b 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId:String = UUID().uuidString + let managerId: String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,8 +111,7 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { + } else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -276,7 +275,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -284,7 +283,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename : String? = nil + var filename: String? for contentItem in items { @@ -295,7 +294,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -304,7 +303,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -318,7 +317,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -329,7 +328,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -fileprivate enum DownloadException : Error { +private enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -344,7 +343,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -436,7 +435,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilde return } - var responseObj: Response? = nil + var responseObj: Response? let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 57bab28b1998..27cf29c65600 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { - var returnedDecodable: T? = nil - var returnedError: Error? = nil + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + var returnedDecodable: T? + var returnedError: Error? do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T : Encodable { + open class func encode(_ value: T) -> EncodeResult where T: Encodable { var returnedData: Data? - var returnedError: Error? = nil + var returnedError: Error? do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 516590da5d9e..e1ecb39726e7 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 1f948ae12f78..74fcfcf2ad49 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,5 +171,3 @@ extension KeyedDecodingContainerProtocol { } } - - diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index ca05906d4206..fb76bbed26f7 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? = nil + var returnedParams: Parameters? if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 6ae673e1f8ca..827bdec87782 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? = nil + var params: Parameters? if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 408563890359..25161165865e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 0ecd9e9d4e0b..83a06951ccd6 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 1050d79dbe9d..5ed9f31e2a36 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4d0393b9ba45..ec270da89074 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index cdd102c3d0e3..3843287630b1 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index d8a83cb03753..f8b198e81f50 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 45719d7100b9..67f7f7e5151f 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index a9b2521b4ba0..d576b50b1c9c 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index c4f6e0d488ca..7ab887f3113f 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 7b1d7e32be80..a51ad0dffab1 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { public var declawed: Bool? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3ec00f5ab10d..eb8f7e5e1974 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index af030c3dd626..e2a7d4427a06 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { public var _class: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 0aae748c76b4..00245ca37280 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { public var client: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 198e28b94dd6..492c1228008e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 8ff49b2af23f..7786f8acc5ae 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { public var breed: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 93a138311b13..5034ff0b8c68 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 7280a621fec7..3c1dfcac577d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 4defea58d77e..6db9b34d183b 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 773b53b2cb76..abf3ccffc485 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 83dc1148cfa3..532f1457939a 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index bccd3f9fb178..20bd6d103b3d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 566d71a35ef0..906ddb06fb17 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift index b29b4547e709..08d59953873e 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 0d8fd2848677..3a10a7dfcaf6 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 710e62a9b587..c3deb2f28932 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 7569b92e8833..78917d75b44d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index d26d95857f64..43c4891e1e23 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index c1578e7a6d45..abd2269e8e76 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 985f4ab1c5b0..a6e1b1d2e5e4 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { public enum Status: String, Codable { case placed = "placed" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index aff2203aec73..49aec001c5db 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index bd1643d279ed..9f80fc95ecf0 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index bb0c4d4318a7..af60a550bb19 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { public enum Status: String, Codable { case available = "available" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b2a6b7e2b8a6..0acd21fd1000 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 72d6444ce88f..b34ddc68142d 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 3eb74d35d491..e79fc45c0e91 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index f65ae0623d6e..3f1237fee477 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a91b6061bcf7..4dd8a9a9f5a0 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index ac559dda6f3f..bf0006e1a266 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 85498b617641..602a2a6d185a 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f70328ca9e59..79f271ed7356 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/Package.swift b/samples/client/petstore/swift4/nonPublicApi/Package.swift index a847bc5077d1..e5c5f0f33b82 100644 --- a/samples/client/petstore/swift4/nonPublicApi/Package.swift +++ b/samples/client/petstore/swift4/nonPublicApi/Package.swift @@ -9,11 +9,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -22,6 +22,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire"], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 93b30800826e..8641eb7ebf77 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation internal struct APIHelper { - internal static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + internal static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ internal struct APIHelper { return destination } - internal static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + internal static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - internal static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + internal static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ internal struct APIHelper { } internal static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - internal static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + internal static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ internal struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift index 04afd1c37640..4e09f94504fc 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation internal class PetstoreClientAPI { internal static var basePath = "http://petstore.swagger.io:80/v2" internal static var credential: URLCredential? - internal static var customHeaders: [String:String] = [:] + internal static var customHeaders: [String: String] = [:] internal static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() internal static var apiResponseQueue: DispatchQueue = .main } internal class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - internal let parameters: [String:Any]? + var headers: [String: String] + internal let parameters: [String: Any]? internal let isBody: Bool internal let method: String internal let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - internal var onProgressReady: ((Progress) -> ())? + internal var onProgressReady: ((Progress) -> Void)? - required internal init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required internal init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ internal class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - internal func addHeaders(_ aHeaders:[String:String]) { + internal func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ internal class RequestBuilder { internal protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 015f165c9f92..9126bafa69ca 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,8 +7,6 @@ import Foundation - - internal class AnotherFakeAPI { /** To test special tags @@ -16,7 +14,7 @@ internal class AnotherFakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - internal class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + internal class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 7814f31d4327..7fcf9f8545df 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,15 +7,13 @@ import Foundation - - internal class FakeAPI { /** - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + internal class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -44,7 +42,7 @@ internal class FakeAPI { - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -73,7 +71,7 @@ internal class FakeAPI { - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + internal class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -102,7 +100,7 @@ internal class FakeAPI { - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + internal class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -131,8 +129,8 @@ internal class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - internal class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + internal class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -165,8 +163,8 @@ internal class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - internal class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + internal class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -202,7 +200,7 @@ internal class FakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - internal class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + internal class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -246,8 +244,8 @@ internal class FakeAPI { - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - 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)) { - testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in + 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)) { + testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -282,7 +280,7 @@ internal class FakeAPI { internal class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -301,7 +299,7 @@ internal class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -389,8 +387,8 @@ internal class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - parameter completion: completion handler to receive the data and the error objects */ - internal class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + internal class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -416,19 +414,19 @@ internal class FakeAPI { internal class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -453,8 +451,8 @@ internal class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -478,13 +476,13 @@ internal class FakeAPI { internal class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -504,8 +502,8 @@ internal class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - internal class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + internal class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -520,7 +518,7 @@ internal class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - internal class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + internal class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -539,8 +537,8 @@ internal class FakeAPI { - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - internal class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + internal class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -559,14 +557,14 @@ internal class FakeAPI { internal class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 47ea5157ae2b..e4c221d8cb41 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,8 +7,6 @@ import Foundation - - internal class FakeClassnameTags123API { /** To test class name in snake case @@ -16,7 +14,7 @@ internal class FakeClassnameTags123API { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - internal class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + internal class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 8745eca9cffa..88b3b5b893c8 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,8 +7,6 @@ import Foundation - - internal class PetAPI { /** Add a new pet to the store @@ -16,8 +14,8 @@ internal class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - internal class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + internal class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -54,8 +52,8 @@ internal class PetAPI { - parameter petId: (path) Pet id to delete - parameter completion: completion handler to receive the data and the error objects */ - internal class func deletePet(apiKey: String? = nil, petId: Int64, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute { (response, error) -> Void in + internal class func deletePet(apiKey: String? = nil, petId: Int64, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -80,8 +78,8 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -108,7 +106,7 @@ internal class PetAPI { - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - internal class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + internal class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -127,8 +125,8 @@ internal class PetAPI { internal class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -145,7 +143,7 @@ internal class PetAPI { - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - internal class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + internal class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -164,8 +162,8 @@ internal class PetAPI { internal class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -182,7 +180,7 @@ internal class PetAPI { - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - internal class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + internal class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -204,8 +202,8 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -219,8 +217,8 @@ internal class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - internal class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + internal class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -258,8 +256,8 @@ internal class PetAPI { - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -285,14 +283,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -308,7 +306,7 @@ internal class PetAPI { - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -331,14 +329,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -354,7 +352,7 @@ internal class PetAPI { - parameter requiredFile: (form) file to upload - parameter completion: completion handler to receive the data and the error objects */ - internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute { (response, error) -> Void in completion(response?.body, error) } @@ -377,14 +375,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index cbf018279aca..cfd546b9095f 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,8 +7,6 @@ import Foundation - - internal class StoreAPI { /** Delete purchase order by ID @@ -16,8 +14,8 @@ internal class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - internal class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + internal class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -39,8 +37,8 @@ internal class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -53,7 +51,7 @@ internal class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ - internal class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + internal class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -68,14 +66,14 @@ internal class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - internal class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + internal class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -86,7 +84,7 @@ internal class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - internal class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + internal class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -105,8 +103,8 @@ internal class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -120,7 +118,7 @@ internal class StoreAPI { - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - internal class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + internal class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 7d85f91c685c..76d77e2cf338 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,8 +7,6 @@ import Foundation - - internal class UserAPI { /** Create user @@ -16,8 +14,8 @@ internal class UserAPI { - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + internal class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -51,8 +49,8 @@ internal class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + internal class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -85,8 +83,8 @@ internal class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + internal class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -119,8 +117,8 @@ internal class UserAPI { - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - internal class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + internal class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -142,8 +140,8 @@ internal class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -157,7 +155,7 @@ internal class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + internal class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -175,8 +173,8 @@ internal class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -191,7 +189,7 @@ internal class UserAPI { - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - internal class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + internal class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -208,11 +206,11 @@ internal class UserAPI { internal class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -226,8 +224,8 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ - internal class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in + internal class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -244,8 +242,8 @@ internal class UserAPI { internal class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -260,8 +258,8 @@ internal class UserAPI { - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - internal class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + internal class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index aef46f478f58..691163584e0e 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() internal class AlamofireRequestBuilder: RequestBuilder { - required internal init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required internal init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ internal class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - internal func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + internal func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override internal func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId:String = UUID().uuidString + let managerId: String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,8 +111,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { + } else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -276,7 +275,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -284,7 +283,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename : String? = nil + var filename: String? for contentItem in items { @@ -295,7 +294,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -304,7 +303,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -318,7 +317,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -329,7 +328,7 @@ internal class AlamofireRequestBuilder: RequestBuilder { } -fileprivate enum DownloadException : Error { +private enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -344,7 +343,7 @@ internal enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -internal class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +internal class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -436,7 +435,7 @@ internal class AlamofireDecodableRequestBuilder: AlamofireRequestBu return } - var responseObj: Response? = nil + var responseObj: Response? let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index c0cfcf2343ec..86c1f884b2e9 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ internal class CodableHelper { set { self.customJSONEncoder = newValue } } - internal class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { - var returnedDecodable: T? = nil - var returnedError: Error? = nil + internal class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + var returnedDecodable: T? + var returnedError: Error? do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ internal class CodableHelper { return (returnedDecodable, returnedError) } - internal class func encode(_ value: T) -> EncodeResult where T : Encodable { + internal class func encode(_ value: T) -> EncodeResult where T: Encodable { var returnedData: Data? - var returnedError: Error? = nil + var returnedError: Error? do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ internal class CodableHelper { return (returnedData, returnedError) } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 8cca45583256..bfcf939d4bb3 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation internal class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. internal static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift index e6ecffbab5de..66f407c1c5f9 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - internal mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + internal mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - internal mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + internal mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - internal mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + internal mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - internal mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + internal mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - internal func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + internal func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - internal func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + internal func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - internal func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + internal func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,5 +171,3 @@ extension KeyedDecodingContainerProtocol { } } - - diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index cb5959f0fa43..bd9f3a2ed0d5 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ internal struct JSONDataEncoding: ParameterEncoding { } internal static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? = nil + var returnedParams: Parameters? if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 22b34d0a00cc..fe09f37cd02f 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire internal class JSONEncodingHelper { - internal class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? = nil + internal class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ internal class JSONEncodingHelper { } internal class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? = nil + var params: Parameters? if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ internal class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift index 336c8848ba9d..5c253abc2c40 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -internal enum ErrorResponse : Error { +internal enum ErrorResponse: Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ internal class Response { internal convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 33150dbca3c5..203d2c1a931d 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +internal struct AdditionalPropertiesClass: Codable { -internal struct AdditionalPropertiesClass: Codable { + internal var mapString: [String: String]? + internal var mapMapString: [String: [String: String]]? - - internal var mapString: [String:String]? - internal var mapMapString: [String:[String:String]]? - - internal init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + internal init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 20d157f4ebcb..ada7f86de509 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Animal: Codable { - +internal struct Animal: Codable { internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index 9c570350859f..3ebe9e9a5dea 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - internal typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 88b4b69c1668..b60d8999b4b2 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct ApiResponse: Codable { - +internal struct ApiResponse: Codable { internal var code: Int? internal var type: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 01a9efa00240..ef26025dcd8f 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct ArrayOfArrayOfNumberOnly: Codable { - +internal struct ArrayOfArrayOfNumberOnly: Codable { internal var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ internal struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index d7bbb8415104..1147e9394c72 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct ArrayOfNumberOnly: Codable { - +internal struct ArrayOfNumberOnly: Codable { internal var arrayNumber: [Double]? @@ -17,7 +15,7 @@ internal struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index a90beac0b422..ffbc3ebc7367 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct ArrayTest: Codable { - +internal struct ArrayTest: Codable { internal var arrayOfString: [String]? internal var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ internal struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 7243c00a658a..52cdbb01be79 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Capitalization: Codable { - +internal struct Capitalization: Codable { internal var smallCamel: String? internal var capitalCamel: String? @@ -28,7 +26,7 @@ internal struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 28292469ddae..8a603dee5f1f 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Cat: Codable { - +internal struct Cat: Codable { internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index cdcb1aa14b57..45b7dbb26dcf 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct CatAllOf: Codable { - +internal struct CatAllOf: Codable { internal var declawed: Bool? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 9b061937e091..849bf788dfb3 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Category: Codable { - +internal struct Category: Codable { internal var id: Int64? internal var name: String = "default-name" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 034cbadc8dd6..0f1bc19fe595 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -internal struct ClassModel: Codable { - +internal struct ClassModel: Codable { internal var _class: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index e33907ca3a3c..ddee836043fa 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Client: Codable { - +internal struct Client: Codable { internal var client: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 3d45b8ac7a13..6b5250de4a4a 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Dog: Codable { - +internal struct Dog: Codable { internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 6fb9a0505161..ef3ff7f1d78b 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct DogAllOf: Codable { - +internal struct DogAllOf: Codable { internal var breed: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 77ba02482620..b84e5e2e1e2f 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct EnumArrays: Codable { - +internal struct EnumArrays: Codable { internal enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ internal struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 432332510cfc..2520f9bd8593 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - internal enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index ee3999df99eb..eba9a8056efd 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct EnumTest: Codable { - +internal struct EnumTest: Codable { internal enum EnumString: String, Codable { case upper = "UPPER" @@ -43,7 +41,7 @@ internal struct EnumTest: Codable { self.outerEnum = outerEnum } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 166138041ecf..632402fb9e03 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -internal struct File: Codable { - +internal struct File: Codable { /** Test capitalization */ internal var sourceURI: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 2245e94bcc90..e478e6c4b7d1 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct FileSchemaTestClass: Codable { - +internal struct FileSchemaTestClass: Codable { internal var file: File? internal var files: [File]? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 30b11efb2e19..23395c93b569 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct FormatTest: Codable { - +internal struct FormatTest: Codable { internal var integer: Int? internal var int32: Int? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index d51b4421dfe6..831963ba2ed2 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct HasOnlyReadOnly: Codable { - +internal struct HasOnlyReadOnly: Codable { internal var bar: String? internal var foo: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 4481dfc69378..ba9579996d19 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct List: Codable { - +internal struct List: Codable { internal var _123list: String? @@ -17,7 +15,7 @@ internal struct List: Codable { self._123list = _123list } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 0f5227354ff2..f59541f76751 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -internal struct MapTest: Codable { - +internal struct MapTest: Codable { internal enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - internal var mapMapOfString: [String:[String:String]]? - internal var mapOfEnumString: [String:String]? - internal var directMap: [String:Bool]? + internal var mapMapOfString: [String: [String: String]]? + internal var mapOfEnumString: [String: String]? + internal var directMap: [String: Bool]? internal var indirectMap: StringBooleanMap? - internal init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + internal init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c6fa4baaecd7..c71bb9256b0a 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable { internal var uuid: UUID? internal var dateTime: Date? - internal var map: [String:Animal]? + internal var map: [String: Animal]? - internal init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + internal init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 2d80f746854b..bd288322e758 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -internal struct Model200Response: Codable { - +internal struct Model200Response: Codable { internal var name: Int? internal var _class: String? @@ -19,7 +18,7 @@ internal struct Model200Response: Codable { self._class = _class } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index cd3d69aa604f..85a5b7953954 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -internal struct Name: Codable { - +internal struct Name: Codable { internal var name: Int internal var snakeCase: Int? @@ -23,7 +22,7 @@ internal struct Name: Codable { self._123number = _123number } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index bcce308e6bf1..7dbe99f1426c 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct NumberOnly: Codable { - +internal struct NumberOnly: Codable { internal var justNumber: Double? @@ -17,7 +15,7 @@ internal struct NumberOnly: Codable { self.justNumber = justNumber } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index c01293b9bb0d..7f575485bf75 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Order: Codable { - +internal struct Order: Codable { internal enum Status: String, Codable { case placed = "placed" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 8bf13de7fdef..04fbad30ef76 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct OuterComposite: Codable { - +internal struct OuterComposite: Codable { internal var myNumber: Double? internal var myString: String? @@ -21,7 +19,7 @@ internal struct OuterComposite: Codable { self.myBoolean = myBoolean } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 790fd71c13d5..fd2d4b4cdda6 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - internal enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index caf33c098ae0..951f5929f922 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Pet: Codable { - +internal struct Pet: Codable { internal enum Status: String, Codable { case available = "available" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 8792cf4aa754..d02c6cc5fd9f 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct ReadOnlyFirst: Codable { - +internal struct ReadOnlyFirst: Codable { internal var bar: String? internal var baz: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 6730250b647d..2e28c04ef55d 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -internal struct Return: Codable { - +internal struct Return: Codable { internal var _return: Int? @@ -17,7 +16,7 @@ internal struct Return: Codable { self._return = _return } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 726a4a00e35e..b35724b1ca7a 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct SpecialModelName: Codable { - +internal struct SpecialModelName: Codable { internal var specialPropertyName: Int64? @@ -17,7 +15,7 @@ internal struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index d1afe6732a46..dc3d00e13014 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +internal struct StringBooleanMap: Codable { -internal struct StringBooleanMap: Codable { - - - - internal var additionalProperties: [String:Bool] = [:] + internal var additionalProperties: [String: Bool] = [:] internal subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ internal struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 923acc9b1f69..1e4de951fb2c 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Tag: Codable { - +internal struct Tag: Codable { internal var id: Int64? internal var name: String? diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 2aac384dba64..0cff6b6a2f8b 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct TypeHolderDefault: Codable { - +internal struct TypeHolderDefault: Codable { internal var stringItem: String = "what" internal var numberItem: Double @@ -25,7 +23,7 @@ internal struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 0a525d8a614b..5d8f63dfe4ae 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct TypeHolderExample: Codable { - +internal struct TypeHolderExample: Codable { internal var stringItem: String internal var numberItem: Double @@ -25,7 +23,7 @@ internal struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - internal enum CodingKeys: String, CodingKey { + internal enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift index c2865a579220..ada8a7f82d96 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct User: Codable { - +internal struct User: Codable { internal var id: Int64? internal var username: String? diff --git a/samples/client/petstore/swift4/objcCompatible/Package.swift b/samples/client/petstore/swift4/objcCompatible/Package.swift index a847bc5077d1..e5c5f0f33b82 100644 --- a/samples/client/petstore/swift4/objcCompatible/Package.swift +++ b/samples/client/petstore/swift4/objcCompatible/Package.swift @@ -9,11 +9,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -22,6 +22,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire"], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift index 13586cdadd87..832282d224f8 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index a25d4f9f2914..89e7eb02109c 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,16 +7,14 @@ import Foundation - - -@objc open class AnotherFakeAPI : NSObject { +@objc open class AnotherFakeAPI: NSObject { /** To test special tags - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index ce2b56509255..19738e6b1e74 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,15 +7,13 @@ import Foundation - - -@objc open class FakeAPI : NSObject { +@objc open class FakeAPI: NSObject { /** - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -44,7 +42,7 @@ import Foundation - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -73,7 +71,7 @@ import Foundation - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -102,7 +100,7 @@ import Foundation - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -131,8 +129,8 @@ import Foundation - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -165,8 +163,8 @@ import Foundation - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -202,7 +200,7 @@ import Foundation - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -246,8 +244,8 @@ import Foundation - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - 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)) { - testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in + 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)) { + testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -282,7 +280,7 @@ import Foundation open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -301,7 +299,7 @@ import Foundation let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -389,8 +387,8 @@ import Foundation - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -416,19 +414,19 @@ import Foundation open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -453,8 +451,8 @@ import Foundation - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -478,13 +476,13 @@ import Foundation open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -504,8 +502,8 @@ import Foundation - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -520,7 +518,7 @@ import Foundation - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -539,8 +537,8 @@ import Foundation - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -559,14 +557,14 @@ import Foundation open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index ba98b694e055..ba8571a22f9d 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,16 +7,14 @@ import Foundation - - -@objc open class FakeClassnameTags123API : NSObject { +@objc open class FakeClassnameTags123API: NSObject { /** To test class name in snake case - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 4d42b6003db6..25c4dfc14918 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,17 +7,15 @@ import Foundation - - -@objc open class PetAPI : NSObject { +@objc open class PetAPI: NSObject { /** Add a new pet to the store - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -54,8 +52,8 @@ import Foundation - parameter apiKey: (header) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -80,8 +78,8 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -108,7 +106,7 @@ import Foundation - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -127,8 +125,8 @@ import Foundation open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -145,7 +143,7 @@ import Foundation - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -164,8 +162,8 @@ import Foundation open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -182,7 +180,7 @@ import Foundation - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -204,8 +202,8 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -219,8 +217,8 @@ import Foundation - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -258,8 +256,8 @@ import Foundation - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -285,14 +283,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -308,7 +306,7 @@ import Foundation - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -331,14 +329,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -354,7 +352,7 @@ import Foundation - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in completion(response?.body, error) } @@ -377,14 +375,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index cd1d037267c5..c2d0578f0a47 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,17 +7,15 @@ import Foundation - - -@objc open class StoreAPI : NSObject { +@objc open class StoreAPI: NSObject { /** Delete purchase order by ID - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -39,8 +37,8 @@ import Foundation let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -53,7 +51,7 @@ import Foundation - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -68,14 +66,14 @@ import Foundation - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -86,7 +84,7 @@ import Foundation - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -105,8 +103,8 @@ import Foundation let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -120,7 +118,7 @@ import Foundation - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 422fea289c86..ad10a9334db6 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,17 +7,15 @@ import Foundation - - -@objc open class UserAPI : NSObject { +@objc open class UserAPI: NSObject { /** Create user - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -51,8 +49,8 @@ import Foundation - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -85,8 +83,8 @@ import Foundation - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -119,8 +117,8 @@ import Foundation - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -142,8 +140,8 @@ import Foundation let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -157,7 +155,7 @@ import Foundation - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -175,8 +173,8 @@ import Foundation let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -191,7 +189,7 @@ import Foundation - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -208,11 +206,11 @@ import Foundation open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -226,8 +224,8 @@ import Foundation - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in + open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -244,8 +242,8 @@ import Foundation open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -260,8 +258,8 @@ import Foundation - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index f8521a9c036e..1d54e695608b 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId:String = UUID().uuidString + let managerId: String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,8 +111,7 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { + } else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -276,7 +275,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -284,7 +283,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename : String? = nil + var filename: String? for contentItem in items { @@ -295,7 +294,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -304,7 +303,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -318,7 +317,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -329,7 +328,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -fileprivate enum DownloadException : Error { +private enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -344,7 +343,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -436,7 +435,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilde return } - var responseObj: Response? = nil + var responseObj: Response? let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 57bab28b1998..27cf29c65600 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { - var returnedDecodable: T? = nil - var returnedError: Error? = nil + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + var returnedDecodable: T? + var returnedError: Error? do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T : Encodable { + open class func encode(_ value: T) -> EncodeResult where T: Encodable { var returnedData: Data? - var returnedError: Error? = nil + var returnedError: Error? do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 516590da5d9e..e1ecb39726e7 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 1f948ae12f78..74fcfcf2ad49 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,5 +171,3 @@ extension KeyedDecodingContainerProtocol { } } - - diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index ca05906d4206..fb76bbed26f7 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? = nil + var returnedParams: Parameters? if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 6ae673e1f8ca..827bdec87782 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? = nil + var params: Parameters? if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index 408563890359..25161165865e 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 6b4ceee8d27f..25a2d8b46c03 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +@objc public class AdditionalPropertiesClass: NSObject, Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? -@objc public class AdditionalPropertiesClass: NSObject, Codable { - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index ca491b8e6ee4..b63ebe3aad4d 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Animal: NSObject, Codable { +@objc public class Animal: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -19,7 +17,7 @@ import Foundation self.color = color } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _className = "className" case color } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index d9a7fae21446..d0fcd4368854 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class ApiResponse: NSObject, Codable { +@objc public class ApiResponse: NSObject, Codable { public var code: Int? public var codeNum: NSNumber? { diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 97f72fd25477..fddd1e8eb2e2 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable { +@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ import Foundation self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 533b1884141a..0a3450dd69f9 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class ArrayOfNumberOnly: NSObject, Codable { +@objc public class ArrayOfNumberOnly: NSObject, Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ import Foundation self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 29777039b221..dbc35d31065c 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class ArrayTest: NSObject, Codable { +@objc public class ArrayTest: NSObject, Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ import Foundation self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 7207f5c4f188..27102732b74e 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Capitalization: NSObject, Codable { +@objc public class Capitalization: NSObject, Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ import Foundation self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 53283a41bf54..c78d15eecbc9 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Cat: NSObject, Codable { +@objc public class Cat: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -26,7 +24,7 @@ import Foundation self.declawed = declawed } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _className = "className" case color case declawed diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8758762c40bf..ef8cec45aff1 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class CatAllOf: NSObject, Codable { +@objc public class CatAllOf: NSObject, Codable { public var declawed: Bool? public var declawedNum: NSNumber? { diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 680e496eebfd..94d01910abe8 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Category: NSObject, Codable { +@objc public class Category: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -24,7 +22,7 @@ import Foundation self.name = name } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case name } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index c221ccf2a0de..4197ffcaed6c 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -@objc public class ClassModel: NSObject, Codable { +@objc public class ClassModel: NSObject, Codable { public var _class: String? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 5aea86fbb06e..517dbbba2ec2 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Client: NSObject, Codable { +@objc public class Client: NSObject, Codable { public var client: String? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index ac99307cf475..e6a878a1ea05 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Dog: NSObject, Codable { +@objc public class Dog: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -21,7 +19,7 @@ import Foundation self.breed = breed } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _className = "className" case color case breed diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index efcd880f10b3..73fd1822725c 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class DogAllOf: NSObject, Codable { +@objc public class DogAllOf: NSObject, Codable { public var breed: String? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 5448468bc989..4e35e79a6820 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class EnumArrays: NSObject, Codable { +@objc public class EnumArrays: NSObject, Codable { public enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ import Foundation self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 7280a621fec7..3c1dfcac577d 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index fb0daceeb9c8..a6906e8bbef9 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class EnumTest: NSObject, Codable { +@objc public class EnumTest: NSObject, Codable { public enum EnumString: String, Codable { case upper = "UPPER" @@ -43,7 +41,7 @@ import Foundation self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 120d5bb78797..7a320c177d38 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -9,7 +9,7 @@ import Foundation /** Must be named `File` for test. */ -@objc public class File: NSObject, Codable { +@objc public class File: NSObject, Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index e60109a85334..a6437b4fe901 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class FileSchemaTestClass: NSObject, Codable { +@objc public class FileSchemaTestClass: NSObject, Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 664481c02fc4..df2c46d3757b 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class FormatTest: NSObject, Codable { +@objc public class FormatTest: NSObject, Codable { public var integer: Int? public var integerNum: NSNumber? { diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 974726b3e65d..b9f5b39117d7 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class HasOnlyReadOnly: NSObject, Codable { +@objc public class HasOnlyReadOnly: NSObject, Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 85845898c713..2ac4bfc90d84 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class List: NSObject, Codable { +@objc public class List: NSObject, Codable { public var _123list: String? @@ -17,7 +15,7 @@ import Foundation self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 9d7f6a88bcc4..4fb067a5ffab 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - - -@objc public class MapTest: NSObject, Codable { +@objc public class MapTest: NSObject, Codable { public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 3ecb79bf9f43..e10adad0a7e1 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - - -@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { +@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index c46291158ddd..2e9399332e6a 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model name starting with number */ -@objc public class Model200Response: NSObject, Codable { +@objc public class Model200Response: NSObject, Codable { public var name: Int? public var nameNum: NSNumber? { @@ -24,7 +24,7 @@ import Foundation self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 61a3276f148b..e30fd5a47152 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model name same as property name */ -@objc public class Name: NSObject, Codable { +@objc public class Name: NSObject, Codable { public var name: Int public var nameNum: NSNumber? { @@ -38,7 +38,7 @@ import Foundation self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index b9b07101be22..9a80fcacc6ca 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class NumberOnly: NSObject, Codable { +@objc public class NumberOnly: NSObject, Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ import Foundation self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index c4804715e8f6..37cfed6adb23 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Order: NSObject, Codable { +@objc public class Order: NSObject, Codable { public enum Status: String, Codable { case placed = "placed" @@ -53,7 +51,7 @@ import Foundation self.complete = complete } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case petId case quantity diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 62e394ec3bde..85ed62455d10 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class OuterComposite: NSObject, Codable { +@objc public class OuterComposite: NSObject, Codable { public var myNumber: Double? public var myString: String? @@ -26,7 +24,7 @@ import Foundation self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index bd1643d279ed..9f80fc95ecf0 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 285d9c54cf70..f99f4d790ec6 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Pet: NSObject, Codable { +@objc public class Pet: NSObject, Codable { public enum Status: String, Codable { case available = "available" @@ -38,7 +36,7 @@ import Foundation self.status = status } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case category case name diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 2c806ac6d756..d1252433b2d8 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class ReadOnlyFirst: NSObject, Codable { +@objc public class ReadOnlyFirst: NSObject, Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index afa39bb66b72..50c3614973df 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing reserved words */ -@objc public class Return: NSObject, Codable { +@objc public class Return: NSObject, Codable { public var _return: Int? public var _returnNum: NSNumber? { @@ -22,7 +22,7 @@ import Foundation self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e55b92ed7a65..0996025cce52 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class SpecialModelName: NSObject, Codable { +@objc public class SpecialModelName: NSObject, Codable { public var specialPropertyName: Int64? public var specialPropertyNameNum: NSNumber? { @@ -22,7 +20,7 @@ import Foundation self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3116d99bff0c..ffe9730a6fe4 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +@objc public class StringBooleanMap: NSObject, Codable { - -@objc public class StringBooleanMap: NSObject, Codable { - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ import Foundation additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index cd46f7db30d5..a3994745e254 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Tag: NSObject, Codable { +@objc public class Tag: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -24,7 +22,7 @@ import Foundation self.name = name } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case name } diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 67e80d3f52c9..382944d1b0d5 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class TypeHolderDefault: NSObject, Codable { +@objc public class TypeHolderDefault: NSObject, Codable { public var stringItem: String = "what" public var numberItem: Double @@ -35,7 +33,7 @@ import Foundation self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 0f7968286201..0344e51e0e34 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class TypeHolderExample: NSObject, Codable { +@objc public class TypeHolderExample: NSObject, Codable { public var stringItem: String public var numberItem: Double @@ -35,7 +33,7 @@ import Foundation self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 0c40ebf7142e..9b9b03a946f8 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class User: NSObject, Codable { +@objc public class User: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -42,7 +40,7 @@ import Foundation self.userStatus = userStatus } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _id = "id" case username case firstName diff --git a/samples/client/petstore/swift4/promisekitLibrary/Package.swift b/samples/client/petstore/swift4/promisekitLibrary/Package.swift index fbf22f5f8236..7ba5c67b456c 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/Package.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/Package.swift @@ -9,12 +9,12 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), - .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.11.0"), + .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.11.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -23,6 +23,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire", "PromiseKit"], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 13586cdadd87..832282d224f8 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 7399d2c1c562..5b75a4da29fe 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,8 +8,6 @@ import Foundation import PromiseKit - - open class AnotherFakeAPI { /** To test special tags diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index e63a581b40cc..9ce9e5b16ae0 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -8,8 +8,6 @@ import Foundation import PromiseKit - - open class FakeAPI { /** @@ -166,7 +164,7 @@ open class FakeAPI { */ open class func testBodyWithFileSchema( body: FileSchemaTestClass) -> Promise { let deferred = Promise.pending() - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -200,9 +198,9 @@ open class FakeAPI { - parameter body: (body) - returns: Promise */ - open class func testBodyWithQueryParams( query: String, body: User) -> Promise { + open class func testBodyWithQueryParams( query: String, body: User) -> Promise { let deferred = Promise.pending() - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -291,9 +289,9 @@ open class FakeAPI { - parameter callback: (form) None (optional) - returns: Promise */ - 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 { + 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 { let deferred = Promise.pending() - testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in + testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -329,7 +327,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -348,7 +346,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -436,9 +434,9 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - returns: Promise */ - open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise { + open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise { let deferred = Promise.pending() - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -465,19 +463,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -502,9 +500,9 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - returns: Promise */ - open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Promise { + open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Promise { let deferred = Promise.pending() - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -529,13 +527,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -555,9 +553,9 @@ open class FakeAPI { - parameter param: (body) request body - returns: Promise */ - open class func testInlineAdditionalProperties( param: [String:String]) -> Promise { + open class func testInlineAdditionalProperties( param: [String: String]) -> Promise { let deferred = Promise.pending() - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -573,7 +571,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -592,9 +590,9 @@ open class FakeAPI { - parameter param2: (form) field2 - returns: Promise */ - open class func testJsonFormData( param: String, param2: String) -> Promise { + open class func testJsonFormData( param: String, param2: String) -> Promise { let deferred = Promise.pending() - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -614,14 +612,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index f43f705eb6fb..574ec49021ba 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,8 +8,6 @@ import Foundation import PromiseKit - - open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 02a5e5417a6f..8d31c177eb97 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,8 +8,6 @@ import Foundation import PromiseKit - - open class PetAPI { /** Add a new pet to the store @@ -19,7 +17,7 @@ open class PetAPI { */ open class func addPet( body: Pet) -> Promise { let deferred = Promise.pending() - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -57,9 +55,9 @@ open class PetAPI { - parameter apiKey: (header) (optional) - returns: Promise */ - open class func deletePet( petId: Int64, apiKey: String? = nil) -> Promise { + open class func deletePet( petId: Int64, apiKey: String? = nil) -> Promise { let deferred = Promise.pending() - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -85,8 +83,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -140,8 +138,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -185,8 +183,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -233,8 +231,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -250,7 +248,7 @@ open class PetAPI { */ open class func updatePet( body: Pet) -> Promise { let deferred = Promise.pending() - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -289,9 +287,9 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - returns: Promise */ - open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil) -> Promise { + open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil) -> Promise { let deferred = Promise.pending() - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -318,14 +316,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -341,7 +339,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - returns: Promise */ - open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Promise { + open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Promise { let deferred = Promise.pending() uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in if let error = error { @@ -372,14 +370,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -395,7 +393,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - returns: Promise */ - open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Promise { + open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Promise { let deferred = Promise.pending() uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in if let error = error { @@ -426,14 +424,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index eeb3548e88a0..685827cebe6a 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,8 +8,6 @@ import Foundation import PromiseKit - - open class StoreAPI { /** Delete purchase order by ID @@ -19,7 +17,7 @@ open class StoreAPI { */ open class func deleteOrder( orderId: String) -> Promise { let deferred = Promise.pending() - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -42,8 +40,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -56,8 +54,8 @@ open class StoreAPI { - returns: Promise<[String:Int]> */ - open class func getInventory() -> Promise<[String:Int]> { - let deferred = Promise<[String:Int]>.pending() + open class func getInventory() -> Promise<[String: Int]> { + let deferred = Promise<[String: Int]>.pending() getInventoryWithRequestBuilder().execute { (response, error) -> Void in if let error = error { deferred.resolver.reject(error) @@ -79,14 +77,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -124,8 +122,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index ab269c056795..83f4674553cb 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,8 +8,6 @@ import Foundation import PromiseKit - - open class UserAPI { /** Create user @@ -19,7 +17,7 @@ open class UserAPI { */ open class func createUser( body: User) -> Promise { let deferred = Promise.pending() - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -56,7 +54,7 @@ open class UserAPI { */ open class func createUsersWithArrayInput( body: [User]) -> Promise { let deferred = Promise.pending() - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -92,7 +90,7 @@ open class UserAPI { */ open class func createUsersWithListInput( body: [User]) -> Promise { let deferred = Promise.pending() - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -128,7 +126,7 @@ open class UserAPI { */ open class func deleteUser( username: String) -> Promise { let deferred = Promise.pending() - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -151,8 +149,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -192,8 +190,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -208,7 +206,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - returns: Promise */ - open class func loginUser( username: String, password: String) -> Promise { + open class func loginUser( username: String, password: String) -> Promise { let deferred = Promise.pending() loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in if let error = error { @@ -233,11 +231,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -253,7 +251,7 @@ open class UserAPI { */ open class func logoutUser() -> Promise { let deferred = Promise.pending() - logoutUserWithRequestBuilder().execute { (response, error) -> Void in + logoutUserWithRequestBuilder().execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { @@ -271,8 +269,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -287,9 +285,9 @@ open class UserAPI { - parameter body: (body) Updated user object - returns: Promise */ - open class func updateUser( username: String, body: User) -> Promise { + open class func updateUser( username: String, body: User) -> Promise { let deferred = Promise.pending() - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in if let error = error { deferred.resolver.reject(error) } else { diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index f8521a9c036e..1d54e695608b 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId:String = UUID().uuidString + let managerId: String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,8 +111,7 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { + } else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -276,7 +275,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -284,7 +283,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename : String? = nil + var filename: String? for contentItem in items { @@ -295,7 +294,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -304,7 +303,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -318,7 +317,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -329,7 +328,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -fileprivate enum DownloadException : Error { +private enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -344,7 +343,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -436,7 +435,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilde return } - var responseObj: Response? = nil + var responseObj: Response? let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 57bab28b1998..27cf29c65600 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { - var returnedDecodable: T? = nil - var returnedError: Error? = nil + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + var returnedDecodable: T? + var returnedError: Error? do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T : Encodable { + open class func encode(_ value: T) -> EncodeResult where T: Encodable { var returnedData: Data? - var returnedError: Error? = nil + var returnedError: Error? do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 516590da5d9e..e1ecb39726e7 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 8278ae0f3b20..0ee7b7f0f6d8 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -109,24 +109,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -136,7 +136,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -148,8 +148,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -158,8 +158,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -174,7 +174,7 @@ extension KeyedDecodingContainerProtocol { } extension RequestBuilder { - public func execute() -> Promise> { + public func execute() -> Promise> { let deferred = Promise>.pending() self.execute { (response: Response?, error: Error?) in if let response = response { diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index ca05906d4206..fb76bbed26f7 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? = nil + var returnedParams: Parameters? if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 6ae673e1f8ca..827bdec87782 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? = nil + var params: Parameters? if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 408563890359..25161165865e 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 0ecd9e9d4e0b..83a06951ccd6 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 1050d79dbe9d..5ed9f31e2a36 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4d0393b9ba45..ec270da89074 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index cdd102c3d0e3..3843287630b1 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index d8a83cb03753..f8b198e81f50 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 45719d7100b9..67f7f7e5151f 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index a9b2521b4ba0..d576b50b1c9c 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index c4f6e0d488ca..7ab887f3113f 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 7b1d7e32be80..a51ad0dffab1 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { public var declawed: Bool? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3ec00f5ab10d..eb8f7e5e1974 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index af030c3dd626..e2a7d4427a06 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { public var _class: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 0aae748c76b4..00245ca37280 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { public var client: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 198e28b94dd6..492c1228008e 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 8ff49b2af23f..7786f8acc5ae 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { public var breed: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 93a138311b13..5034ff0b8c68 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 7280a621fec7..3c1dfcac577d 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 4defea58d77e..6db9b34d183b 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 773b53b2cb76..abf3ccffc485 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 83dc1148cfa3..532f1457939a 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index bccd3f9fb178..20bd6d103b3d 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 566d71a35ef0..906ddb06fb17 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index b29b4547e709..08d59953873e 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 0d8fd2848677..3a10a7dfcaf6 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 710e62a9b587..c3deb2f28932 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 7569b92e8833..78917d75b44d 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index d26d95857f64..43c4891e1e23 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index c1578e7a6d45..abd2269e8e76 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 985f4ab1c5b0..a6e1b1d2e5e4 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { public enum Status: String, Codable { case placed = "placed" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index aff2203aec73..49aec001c5db 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index bd1643d279ed..9f80fc95ecf0 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index bb0c4d4318a7..af60a550bb19 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { public enum Status: String, Codable { case available = "available" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b2a6b7e2b8a6..0acd21fd1000 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 72d6444ce88f..b34ddc68142d 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 3eb74d35d491..e79fc45c0e91 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index f65ae0623d6e..3f1237fee477 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a91b6061bcf7..4dd8a9a9f5a0 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index ac559dda6f3f..bf0006e1a266 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 85498b617641..602a2a6d185a 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f70328ca9e59..79f271ed7356 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift4/resultLibrary/Package.swift b/samples/client/petstore/swift4/resultLibrary/Package.swift index a847bc5077d1..e5c5f0f33b82 100644 --- a/samples/client/petstore/swift4/resultLibrary/Package.swift +++ b/samples/client/petstore/swift4/resultLibrary/Package.swift @@ -9,11 +9,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -22,6 +22,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire"], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 13586cdadd87..832282d224f8 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 0cde67c78990..fb4bb8cfdb43 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class AnotherFakeAPI { /** To test special tags @@ -16,7 +14,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 3bd57a0b50d1..341e23d3685b 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,15 +7,13 @@ import Foundation - - open class FakeAPI { /** - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -60,7 +58,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -105,7 +103,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -150,7 +148,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -195,8 +193,8 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -210,7 +208,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ result: Result) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -243,8 +241,8 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -259,7 +257,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ result: Result) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -295,7 +293,7 @@ open class FakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -356,8 +354,8 @@ open class FakeAPI { - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - 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)) { - testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in + 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)) { + testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -385,7 +383,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ 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 ((_ result: Result) -> Void)) { - testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in + testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -420,7 +418,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -439,7 +437,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -527,8 +525,8 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -550,7 +548,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ result: Result) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -576,19 +574,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -613,8 +611,8 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -634,7 +632,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ result: Result) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -658,13 +656,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -684,8 +682,8 @@ open class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -699,8 +697,8 @@ open class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the result */ - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ result: Result) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ result: Result) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -715,7 +713,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -734,8 +732,8 @@ open class FakeAPI { - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -751,7 +749,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ result: Result) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -770,14 +768,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 3ee95e0d558e..09c9696dec65 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,8 +7,6 @@ import Foundation - - open class FakeClassnameTags123API { /** To test class name in snake case @@ -16,7 +14,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index f6453d755eb4..3c0ac53738ab 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class PetAPI { /** Add a new pet to the store @@ -16,8 +14,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -32,7 +30,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ open class func addPet(body: Pet, completion: @escaping ((_ result: Result) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -69,8 +67,8 @@ open class PetAPI { - parameter apiKey: (header) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -86,7 +84,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ result: Result) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -111,8 +109,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -139,7 +137,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -175,8 +173,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -193,7 +191,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -229,8 +227,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -247,7 +245,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -286,8 +284,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -301,8 +299,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -317,7 +315,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ open class func updatePet(body: Pet, completion: @escaping ((_ result: Result) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -355,8 +353,8 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -373,7 +371,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ result: Result) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -399,14 +397,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -422,7 +420,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -464,14 +462,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -487,7 +485,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in completion(response?.body, error) } @@ -529,14 +527,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 3540be19c3e2..62ae519105c5 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class StoreAPI { /** Delete purchase order by ID @@ -16,8 +14,8 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -32,7 +30,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the result */ open class func deleteOrder(orderId: String, completion: @escaping ((_ result: Result) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -54,8 +52,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -68,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -78,7 +76,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the result */ - open class func getInventory(completion: @escaping ((_ result: Result<[String:Int], Error>) -> Void)) { + open class func getInventory(completion: @escaping ((_ result: Result<[String: Int], Error>) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in if let error = error { completion(.failure(error)) @@ -99,14 +97,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -117,7 +115,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -153,8 +151,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -168,7 +166,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 6ee23f9b678c..c65cdfa1bce3 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class UserAPI { /** Create user @@ -16,8 +14,8 @@ open class UserAPI { - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -32,7 +30,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ open class func createUser(body: User, completion: @escaping ((_ result: Result) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -66,8 +64,8 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -82,7 +80,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ result: Result) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -115,8 +113,8 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -131,7 +129,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ open class func createUsersWithListInput(body: [User], completion: @escaping ((_ result: Result) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -164,8 +162,8 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -180,7 +178,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ open class func deleteUser(username: String, completion: @escaping ((_ result: Result) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -202,8 +200,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -217,7 +215,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -252,8 +250,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -268,7 +266,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -303,11 +301,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -321,8 +319,8 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in + open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -336,7 +334,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ open class func logoutUser(completion: @escaping ((_ result: Result) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in + logoutUserWithRequestBuilder().execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { @@ -353,8 +351,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -369,8 +367,8 @@ open class UserAPI { - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -386,7 +384,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ open class func updateUser(username: String, body: User, completion: @escaping ((_ result: Result) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in if let error = error { completion(.failure(error)) } else { diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index f8521a9c036e..1d54e695608b 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId:String = UUID().uuidString + let managerId: String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,8 +111,7 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { + } else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -276,7 +275,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -284,7 +283,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename : String? = nil + var filename: String? for contentItem in items { @@ -295,7 +294,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -304,7 +303,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -318,7 +317,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -329,7 +328,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -fileprivate enum DownloadException : Error { +private enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -344,7 +343,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -436,7 +435,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilde return } - var responseObj: Response? = nil + var responseObj: Response? let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 57bab28b1998..27cf29c65600 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { - var returnedDecodable: T? = nil - var returnedError: Error? = nil + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + var returnedDecodable: T? + var returnedError: Error? do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T : Encodable { + open class func encode(_ value: T) -> EncodeResult where T: Encodable { var returnedData: Data? - var returnedError: Error? = nil + var returnedError: Error? do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 516590da5d9e..e1ecb39726e7 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 1f948ae12f78..74fcfcf2ad49 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,5 +171,3 @@ extension KeyedDecodingContainerProtocol { } } - - diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index ca05906d4206..fb76bbed26f7 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? = nil + var returnedParams: Parameters? if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 6ae673e1f8ca..827bdec87782 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? = nil + var params: Parameters? if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 408563890359..25161165865e 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 0ecd9e9d4e0b..83a06951ccd6 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 1050d79dbe9d..5ed9f31e2a36 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4d0393b9ba45..ec270da89074 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index cdd102c3d0e3..3843287630b1 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index d8a83cb03753..f8b198e81f50 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 45719d7100b9..67f7f7e5151f 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index a9b2521b4ba0..d576b50b1c9c 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index c4f6e0d488ca..7ab887f3113f 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 7b1d7e32be80..a51ad0dffab1 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { public var declawed: Bool? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3ec00f5ab10d..eb8f7e5e1974 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index af030c3dd626..e2a7d4427a06 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { public var _class: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 0aae748c76b4..00245ca37280 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { public var client: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 198e28b94dd6..492c1228008e 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 8ff49b2af23f..7786f8acc5ae 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { public var breed: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 93a138311b13..5034ff0b8c68 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 7280a621fec7..3c1dfcac577d 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 4defea58d77e..6db9b34d183b 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 773b53b2cb76..abf3ccffc485 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 83dc1148cfa3..532f1457939a 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index bccd3f9fb178..20bd6d103b3d 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 566d71a35ef0..906ddb06fb17 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index b29b4547e709..08d59953873e 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 0d8fd2848677..3a10a7dfcaf6 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 710e62a9b587..c3deb2f28932 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 7569b92e8833..78917d75b44d 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index d26d95857f64..43c4891e1e23 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index c1578e7a6d45..abd2269e8e76 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 985f4ab1c5b0..a6e1b1d2e5e4 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { public enum Status: String, Codable { case placed = "placed" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index aff2203aec73..49aec001c5db 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index bd1643d279ed..9f80fc95ecf0 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index bb0c4d4318a7..af60a550bb19 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { public enum Status: String, Codable { case available = "available" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b2a6b7e2b8a6..0acd21fd1000 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 72d6444ce88f..b34ddc68142d 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 3eb74d35d491..e79fc45c0e91 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index f65ae0623d6e..3f1237fee477 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a91b6061bcf7..4dd8a9a9f5a0 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index ac559dda6f3f..bf0006e1a266 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 85498b617641..602a2a6d185a 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f70328ca9e59..79f271ed7356 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/Package.swift b/samples/client/petstore/swift4/rxswiftLibrary/Package.swift index ad243b475b41..6c19a2b64cc6 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/Package.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/Package.swift @@ -9,12 +9,12 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), - .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "4.5.0"), + .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "4.5.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -23,6 +23,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire", "RxSwift"], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 13586cdadd87..832282d224f8 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 172d3e1d6c10..819fc85beda2 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,8 +8,6 @@ import Foundation import RxSwift - - open class AnotherFakeAPI { /** To test special tags diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 3c3862c01cea..a20128c73813 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -8,8 +8,6 @@ import Foundation import RxSwift - - open class FakeAPI { /** @@ -174,7 +172,7 @@ open class FakeAPI { */ open class func testBodyWithFileSchema(body: FileSchemaTestClass) -> Observable { return Observable.create { observer -> Disposable in - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -212,7 +210,7 @@ open class FakeAPI { */ open class func testBodyWithQueryParams(query: String, body: User) -> Observable { return Observable.create { observer -> Disposable in - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -307,7 +305,7 @@ open class FakeAPI { */ 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 { return Observable.create { observer -> Disposable in - testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in + testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -345,7 +343,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -364,7 +362,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -454,7 +452,7 @@ open class FakeAPI { */ open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Observable { return Observable.create { observer -> Disposable in - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -483,19 +481,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -522,7 +520,7 @@ open class FakeAPI { */ open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Observable { return Observable.create { observer -> Disposable in - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -549,13 +547,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -575,9 +573,9 @@ open class FakeAPI { - parameter param: (body) request body - returns: Observable */ - open class func testInlineAdditionalProperties(param: [String:String]) -> Observable { + open class func testInlineAdditionalProperties(param: [String: String]) -> Observable { return Observable.create { observer -> Disposable in - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -595,7 +593,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -616,7 +614,7 @@ open class FakeAPI { */ open class func testJsonFormData(param: String, param2: String) -> Observable { return Observable.create { observer -> Disposable in - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -638,14 +636,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 0129283fe4d2..c34ace880ce8 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,8 +8,6 @@ import Foundation import RxSwift - - open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 556ebcef5e8f..6b4797fc19a1 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,8 +8,6 @@ import Foundation import RxSwift - - open class PetAPI { /** Add a new pet to the store @@ -19,7 +17,7 @@ open class PetAPI { */ open class func addPet(body: Pet) -> Observable { return Observable.create { observer -> Disposable in - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -61,7 +59,7 @@ open class PetAPI { */ open class func deletePet(petId: Int64, apiKey: String? = nil) -> Observable { return Observable.create { observer -> Disposable in - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -89,8 +87,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -146,8 +144,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -193,8 +191,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -243,8 +241,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -260,7 +258,7 @@ open class PetAPI { */ open class func updatePet(body: Pet) -> Observable { return Observable.create { observer -> Disposable in - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -303,7 +301,7 @@ open class PetAPI { */ open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil) -> Observable { return Observable.create { observer -> Disposable in - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -332,14 +330,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -388,14 +386,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -444,14 +442,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index a8c2b20948ef..c03311277b9a 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,8 +8,6 @@ import Foundation import RxSwift - - open class StoreAPI { /** Delete purchase order by ID @@ -19,7 +17,7 @@ open class StoreAPI { */ open class func deleteOrder(orderId: String) -> Observable { return Observable.create { observer -> Disposable in - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -44,8 +42,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -58,7 +56,7 @@ open class StoreAPI { - returns: Observable<[String:Int]> */ - open class func getInventory() -> Observable<[String:Int]> { + open class func getInventory() -> Observable<[String: Int]> { return Observable.create { observer -> Disposable in getInventoryWithRequestBuilder().execute { (response, error) -> Void in if let error = error { @@ -83,14 +81,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -130,8 +128,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 2a877f7c7f06..ec28b4121d09 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,8 +8,6 @@ import Foundation import RxSwift - - open class UserAPI { /** Create user @@ -19,7 +17,7 @@ open class UserAPI { */ open class func createUser(body: User) -> Observable { return Observable.create { observer -> Disposable in - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -58,7 +56,7 @@ open class UserAPI { */ open class func createUsersWithArrayInput(body: [User]) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -96,7 +94,7 @@ open class UserAPI { */ open class func createUsersWithListInput(body: [User]) -> Observable { return Observable.create { observer -> Disposable in - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -134,7 +132,7 @@ open class UserAPI { */ open class func deleteUser(username: String) -> Observable { return Observable.create { observer -> Disposable in - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -159,8 +157,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -202,8 +200,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -245,11 +243,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -265,7 +263,7 @@ open class UserAPI { */ open class func logoutUser() -> Observable { return Observable.create { observer -> Disposable in - logoutUserWithRequestBuilder().execute { (response, error) -> Void in + logoutUserWithRequestBuilder().execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { @@ -285,8 +283,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -303,7 +301,7 @@ open class UserAPI { */ open class func updateUser(username: String, body: User) -> Observable { return Observable.create { observer -> Disposable in - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in if let error = error { observer.onError(error) } else { diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index f8521a9c036e..1d54e695608b 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId:String = UUID().uuidString + let managerId: String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,8 +111,7 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { + } else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -276,7 +275,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -284,7 +283,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename : String? = nil + var filename: String? for contentItem in items { @@ -295,7 +294,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -304,7 +303,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -318,7 +317,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -329,7 +328,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -fileprivate enum DownloadException : Error { +private enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -344,7 +343,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -436,7 +435,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilde return } - var responseObj: Response? = nil + var responseObj: Response? let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 57bab28b1998..27cf29c65600 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { - var returnedDecodable: T? = nil - var returnedError: Error? = nil + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + var returnedDecodable: T? + var returnedError: Error? do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T : Encodable { + open class func encode(_ value: T) -> EncodeResult where T: Encodable { var returnedData: Data? - var returnedError: Error? = nil + var returnedError: Error? do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 516590da5d9e..e1ecb39726e7 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 1f948ae12f78..74fcfcf2ad49 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,5 +171,3 @@ extension KeyedDecodingContainerProtocol { } } - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index ca05906d4206..fb76bbed26f7 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? = nil + var returnedParams: Parameters? if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 6ae673e1f8ca..827bdec87782 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? = nil + var params: Parameters? if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 408563890359..25161165865e 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 0ecd9e9d4e0b..83a06951ccd6 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 1050d79dbe9d..5ed9f31e2a36 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4d0393b9ba45..ec270da89074 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index cdd102c3d0e3..3843287630b1 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index d8a83cb03753..f8b198e81f50 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 45719d7100b9..67f7f7e5151f 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index a9b2521b4ba0..d576b50b1c9c 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index c4f6e0d488ca..7ab887f3113f 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 7b1d7e32be80..a51ad0dffab1 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { public var declawed: Bool? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3ec00f5ab10d..eb8f7e5e1974 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index af030c3dd626..e2a7d4427a06 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { public var _class: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 0aae748c76b4..00245ca37280 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { public var client: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 198e28b94dd6..492c1228008e 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 8ff49b2af23f..7786f8acc5ae 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { public var breed: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 93a138311b13..5034ff0b8c68 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 7280a621fec7..3c1dfcac577d 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 4defea58d77e..6db9b34d183b 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 773b53b2cb76..abf3ccffc485 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 83dc1148cfa3..532f1457939a 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index bccd3f9fb178..20bd6d103b3d 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 566d71a35ef0..906ddb06fb17 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index b29b4547e709..08d59953873e 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 0d8fd2848677..3a10a7dfcaf6 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 710e62a9b587..c3deb2f28932 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 7569b92e8833..78917d75b44d 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index d26d95857f64..43c4891e1e23 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index c1578e7a6d45..abd2269e8e76 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 985f4ab1c5b0..a6e1b1d2e5e4 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { public enum Status: String, Codable { case placed = "placed" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index aff2203aec73..49aec001c5db 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index bd1643d279ed..9f80fc95ecf0 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index bb0c4d4318a7..af60a550bb19 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { public enum Status: String, Codable { case available = "available" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b2a6b7e2b8a6..0acd21fd1000 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 72d6444ce88f..b34ddc68142d 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 3eb74d35d491..e79fc45c0e91 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index f65ae0623d6e..3f1237fee477 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a91b6061bcf7..4dd8a9a9f5a0 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index ac559dda6f3f..bf0006e1a266 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 85498b617641..602a2a6d185a 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f70328ca9e59..79f271ed7356 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/Package.swift b/samples/client/petstore/swift4/unwrapRequired/Package.swift index a847bc5077d1..e5c5f0f33b82 100644 --- a/samples/client/petstore/swift4/unwrapRequired/Package.swift +++ b/samples/client/petstore/swift4/unwrapRequired/Package.swift @@ -9,11 +9,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -22,6 +22,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["Alamofire"], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift index 13586cdadd87..832282d224f8 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 1e6b7fc02c2c..02e24286e3c8 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class AnotherFakeAPI { /** To test special tags @@ -16,7 +14,7 @@ open class AnotherFakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index d04aec357766..8f5d7550f0c8 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,15 +7,13 @@ import Foundation - - open class FakeAPI { /** - parameter body: (body) Input boolean as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -44,7 +42,7 @@ open class FakeAPI { - parameter body: (body) Input composite as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -73,7 +71,7 @@ open class FakeAPI { - parameter body: (body) Input number as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -102,7 +100,7 @@ open class FakeAPI { - parameter body: (body) Input string as post body (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -131,8 +129,8 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -165,8 +163,8 @@ open class FakeAPI { - parameter body: (body) - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (response, error) -> Void in + open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -202,7 +200,7 @@ open class FakeAPI { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } @@ -246,8 +244,8 @@ open class FakeAPI { - parameter callback: (form) None (optional) - parameter completion: completion handler to receive the data and the error objects */ - 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)) { - testEndpointParametersWithRequestBuilder(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).execute { (response, error) -> Void in + 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)) { + testEndpointParametersWithRequestBuilder(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).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -282,7 +280,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -301,7 +299,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -389,8 +387,8 @@ open class FakeAPI { - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (response, error) -> Void in + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -416,19 +414,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -453,8 +451,8 @@ open class FakeAPI { - parameter int64Group: (query) Integer in group parameters (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (response, error) -> Void in + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -478,13 +476,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -504,8 +502,8 @@ open class FakeAPI { - parameter param: (body) request body - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (response, error) -> Void in + open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -520,7 +518,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -539,8 +537,8 @@ open class FakeAPI { - parameter param2: (form) field2 - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -559,14 +557,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 822a371cef34..060d434fbf24 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,8 +7,6 @@ import Foundation - - open class FakeClassnameTags123API { /** To test class name in snake case @@ -16,7 +14,7 @@ open class FakeClassnameTags123API { - parameter body: (body) client model - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index cc4397947d1d..fe75962a72cf 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class PetAPI { /** Add a new pet to the store @@ -16,8 +14,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -54,8 +52,8 @@ open class PetAPI { - parameter apiKey: (header) (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -80,8 +78,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -108,7 +106,7 @@ open class PetAPI { - parameter status: (query) Status values that need to be considered for filter - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in completion(response?.body, error) } @@ -127,8 +125,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -145,7 +143,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in completion(response?.body, error) } @@ -164,8 +162,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -182,7 +180,7 @@ open class PetAPI { - parameter petId: (path) ID of pet to return - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -204,8 +202,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -219,8 +217,8 @@ open class PetAPI { - parameter body: (body) Pet object that needs to be added to the store - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -258,8 +256,8 @@ open class PetAPI { - parameter status: (form) Updated status of the pet (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -285,14 +283,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -308,7 +306,7 @@ open class PetAPI { - parameter file: (form) file to upload (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in completion(response?.body, error) } @@ -331,14 +329,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -354,7 +352,7 @@ open class PetAPI { - parameter additionalMetadata: (form) Additional data to pass to server (optional) - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in completion(response?.body, error) } @@ -377,14 +375,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index b62f18f3f020..d5f627df52ac 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class StoreAPI { /** Delete purchase order by ID @@ -16,8 +14,8 @@ open class StoreAPI { - parameter orderId: (path) ID of the order that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -39,8 +37,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -53,7 +51,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute { (response, error) -> Void in completion(response?.body, error) } @@ -68,14 +66,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -86,7 +84,7 @@ open class StoreAPI { - parameter orderId: (path) ID of pet that needs to be fetched - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -105,8 +103,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -120,7 +118,7 @@ open class StoreAPI { - parameter body: (body) order placed for purchasing the pet - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in completion(response?.body, error) } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 0e2d140e037d..ef4f971a91e2 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class UserAPI { /** Create user @@ -16,8 +14,8 @@ open class UserAPI { - parameter body: (body) Created user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -51,8 +49,8 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -85,8 +83,8 @@ open class UserAPI { - parameter body: (body) List of user object - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (response, error) -> Void in + open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -119,8 +117,8 @@ open class UserAPI { - parameter username: (path) The name that needs to be deleted - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -142,8 +140,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -157,7 +155,7 @@ open class UserAPI { - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in completion(response?.body, error) } @@ -175,8 +173,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -191,7 +189,7 @@ open class UserAPI { - parameter password: (query) The password for login in clear text - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in completion(response?.body, error) } @@ -208,11 +206,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -226,8 +224,8 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in + open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (_, error) -> Void in if error == nil { completion((), error) } else { @@ -244,8 +242,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -260,8 +258,8 @@ open class UserAPI { - parameter body: (body) Updated user object - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (response, error) -> Void in + open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in if error == nil { completion((), error) } else { diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index f8521a9c036e..1d54e695608b 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId:String = UUID().uuidString + let managerId: String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,8 +111,7 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { + } else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -276,7 +275,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -284,7 +283,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename : String? = nil + var filename: String? for contentItem in items { @@ -295,7 +294,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -304,7 +303,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -318,7 +317,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -329,7 +328,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -fileprivate enum DownloadException : Error { +private enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -344,7 +343,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -436,7 +435,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilde return } - var responseObj: Response? = nil + var responseObj: Response? let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 57bab28b1998..27cf29c65600 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { - var returnedDecodable: T? = nil - var returnedError: Error? = nil + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + var returnedDecodable: T? + var returnedError: Error? do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T : Encodable { + open class func encode(_ value: T) -> EncodeResult where T: Encodable { var returnedData: Data? - var returnedError: Error? = nil + var returnedError: Error? do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 516590da5d9e..e1ecb39726e7 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 1f948ae12f78..74fcfcf2ad49 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,5 +171,3 @@ extension KeyedDecodingContainerProtocol { } } - - diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index ca05906d4206..fb76bbed26f7 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? = nil + var returnedParams: Parameters? if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 6ae673e1f8ca..827bdec87782 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? = nil + var params: Parameters? if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift index 408563890359..25161165865e 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 0ecd9e9d4e0b..83a06951ccd6 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index ebfccc6ca8e2..88eceebd2a2a 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String? public var color: String? = "red" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4d0393b9ba45..ec270da89074 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index cdd102c3d0e3..3843287630b1 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index d8a83cb03753..f8b198e81f50 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 45719d7100b9..67f7f7e5151f 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index a9b2521b4ba0..d576b50b1c9c 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7679dfd2d3ac..d6133a3dd5ca 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { public var className: String? public var color: String? = "red" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 7b1d7e32be80..a51ad0dffab1 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { public var declawed: Bool? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 1366c0d51315..48b43fc318df 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index af030c3dd626..e2a7d4427a06 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { public var _class: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 0aae748c76b4..00245ca37280 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { public var client: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index ec7cd824eafa..35c8cea0dd04 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { public var className: String? public var color: String? = "red" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 8ff49b2af23f..7786f8acc5ae 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { public var breed: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 93a138311b13..5034ff0b8c68 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 7280a621fec7..3c1dfcac577d 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index aa05b5552b3e..b1eb8e98f89a 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 773b53b2cb76..abf3ccffc485 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 83dc1148cfa3..532f1457939a 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index dc82420e0d9c..4eed10b95a11 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 566d71a35ef0..906ddb06fb17 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift index b29b4547e709..08d59953873e 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _123list = "123-list" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 0d8fd2848677..3a10a7dfcaf6 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 710e62a9b587..c3deb2f28932 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 7569b92e8833..78917d75b44d 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case _class = "class" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 818bcc3a2fbf..785c43bda4c6 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int? public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index c1578e7a6d45..abd2269e8e76 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 985f4ab1c5b0..a6e1b1d2e5e4 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { public enum Status: String, Codable { case placed = "placed" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index aff2203aec73..49aec001c5db 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index bd1643d279ed..9f80fc95ecf0 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 715658cd5286..99eaa1329e48 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { public enum Status: String, Codable { case available = "available" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b2a6b7e2b8a6..0acd21fd1000 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 72d6444ce88f..b34ddc68142d 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case _return = "return" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 3eb74d35d491..e79fc45c0e91 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index f65ae0623d6e..3f1237fee477 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a91b6061bcf7..4dd8a9a9f5a0 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index cd44dea4a127..07b590ab1079 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String? = "what" public var numberItem: Double? @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 706d484fa293..29d005161783 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String? public var numberItem: Double? @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f70328ca9e59..79f271ed7356 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/Package.swift b/samples/client/petstore/swift5/alamofireLibrary/Package.swift index 6e820c6971b0..9371b3d57bd4 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/Package.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/Package.swift @@ -14,19 +14,19 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.1"), + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.1") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "PetstoreClient", - dependencies: ["Alamofire", ], + dependencies: ["Alamofire" ], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index b229fb3e81b8..df7fa3936700 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index bb3ae7178254..5bbf323f820c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class AnotherFakeAPI { /** To test special tags @@ -17,7 +15,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): 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 d1d81faa335c..134d6aea416a 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 @@ -7,8 +7,6 @@ import Foundation - - open class FakeAPI { /** @@ -16,7 +14,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -51,7 +49,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -86,7 +84,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -121,7 +119,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -156,7 +154,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -192,7 +190,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -231,7 +229,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -281,7 +279,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(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).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -318,7 +316,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -337,7 +335,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -426,7 +424,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -454,19 +452,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -492,7 +490,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -518,13 +516,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -545,7 +543,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -562,7 +560,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -582,7 +580,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -603,14 +601,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index d21c4a49d43d..48cfe7187b9a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,8 +7,6 @@ import Foundation - - open class FakeClassnameTags123API { /** To test class name in snake case @@ -17,7 +15,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 496da91171ac..0552d4a6c16e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class PetAPI { /** Add a new pet to the store @@ -17,7 +15,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -57,7 +55,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -84,8 +82,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -113,7 +111,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -137,8 +135,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -156,7 +154,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +178,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +197,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +224,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +240,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +281,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +309,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +333,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +361,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -387,7 +385,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -415,14 +413,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 3848eda85ad6..a8a83eda39a4 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class StoreAPI { /** Delete purchase order by ID @@ -17,7 +15,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -41,8 +39,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -56,7 +54,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -76,14 +74,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -95,7 +93,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,8 +117,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -135,7 +133,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 546166841d9e..505ed1b0c5c9 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class UserAPI { /** Create user @@ -17,7 +15,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -54,7 +52,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -90,7 +88,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -126,7 +124,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -150,8 +148,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -166,7 +164,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -189,8 +187,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -206,7 +204,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -228,11 +226,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -247,7 +245,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -266,8 +264,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -283,7 +281,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: 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 e7320f28ec57..368b4edffb93 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -21,7 +21,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -59,17 +59,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let managerId:String = UUID().uuidString + let managerId: String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -82,8 +82,7 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { + } else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -102,7 +101,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } self.processRequest(request: upload, managerId, apiResponseQueue, completion) case .failure(let encodingError): - apiResponseQueue.async{ + apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, encodingError))) } } @@ -132,14 +131,14 @@ open class AlamofireRequestBuilder: RequestBuilder { case is String.Type: validatedRequest.responseString(queue: apiResponseQueue, completionHandler: { (stringResponse) in cleanupRequest() - + switch stringResponse.result { case let .success(value): completion(.success(Response(response: stringResponse.response!, body: value as? T))) case let .failure(error): completion(.failure(ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, error))) } - + }) case is URL.Type: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (dataResponse) in @@ -188,26 +187,26 @@ open class AlamofireRequestBuilder: RequestBuilder { case is Void.Type: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (voidResponse) in cleanupRequest() - + switch voidResponse.result { case .success: completion(.success(Response(response: voidResponse.response!, body: nil))) case let .failure(error): completion(.failure(ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, error))) } - + }) default: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (dataResponse) in cleanupRequest() - + switch dataResponse.result { case .success: completion(.success(Response(response: dataResponse.response!, body: dataResponse.data as? T))) case let .failure(error): completion(.failure(ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, error))) } - + }) } } @@ -220,7 +219,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -228,7 +227,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename : String? = nil + var filename: String? for contentItem in items { @@ -239,7 +238,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -248,7 +247,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -262,7 +261,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -273,7 +272,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ apiResponseQueue: DispatchQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let credential = self.credential { @@ -290,7 +289,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilde case is String.Type: validatedRequest.responseString(queue: apiResponseQueue, completionHandler: { (stringResponse) in cleanupRequest() - + switch stringResponse.result { case let .success(value): completion(.success(Response(response: stringResponse.response!, body: value as? T))) @@ -302,7 +301,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilde case is Void.Type: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (voidResponse) in cleanupRequest() - + switch voidResponse.result { case .success: completion(.success(Response(response: voidResponse.response!, body: nil))) @@ -314,7 +313,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilde case is Data.Type: validatedRequest.responseData(queue: apiResponseQueue, completionHandler: { (dataResponse) in cleanupRequest() - + switch dataResponse.result { case .success: completion(.success(Response(response: dataResponse.response!, body: dataResponse.data as? T))) @@ -343,14 +342,14 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilde } let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } - + }) } } @@ -358,9 +357,9 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilde } extension JSONDataEncoding: ParameterEncoding { - + // MARK: Encoding - + /// Creates a URL request by encoding parameters and applying them onto an existing request. /// /// - parameter urlRequest: The request to have parameters applied. @@ -372,7 +371,7 @@ extension JSONDataEncoding: ParameterEncoding { /// - returns: The encoded request. public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { let urlRequest = try urlRequest.asURLRequest() - + return self.encode(urlRequest, with: parameters) } } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 4dc1d70aeb52..32e194f6ee12 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index f171525e4394..627d9adb757e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 6e279679c67a..93ed6b90b376 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,5 +177,3 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } - - diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index 08f1ef334dff..b79e9f5e64d5 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? = nil + var returnedParams: [String: Any]? if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 314f1eff1f9b..02f78ffb4705 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? = nil + var params: [String: Any]? if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 9bf69037bf03..4dd8815847c6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } -public enum DownloadException : Error { +public enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -30,7 +30,6 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } - open class Response { public let statusCode: Int public let header: [String: String] @@ -44,7 +43,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 28ca8377b889..1af031535967 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 1050d79dbe9d..5ed9f31e2a36 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4d0393b9ba45..ec270da89074 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 1363c96394ba..6c252ed475b2 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 6b8873730c43..e84eb5d65025 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 64f7c6d9db99..d2140933d181 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index ddb669a59045..d1b3b27616ed 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index c4f6e0d488ca..7ab887f3113f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 7b1d7e32be80..a51ad0dffab1 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3ec00f5ab10d..eb8f7e5e1974 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index af030c3dd626..e2a7d4427a06 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { public var _class: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 0aae748c76b4..00245ca37280 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { public var client: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 198e28b94dd6..492c1228008e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 8ff49b2af23f..7786f8acc5ae 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { public var breed: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index e2d3fa04f94b..9844e7c40e35 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c2c639ba3246..d4029d73f8af 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index a56e1f36389b..789f583e1d77 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 773b53b2cb76..abf3ccffc485 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 83dc1148cfa3..532f1457939a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index bccd3f9fb178..20bd6d103b3d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 566d71a35ef0..906ddb06fb17 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 80cecab242f2..fe13d302ccbf 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index f0c02de95f7a..4b6037f378ee 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 710e62a9b587..c3deb2f28932 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 450a53b918ca..b61db7d6e716 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 6deb69fcd731..8ab4db44b73a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 0c9ee2b7b9f4..4d1dafcc2c1f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index ab0eac0b304e..40c30cc8609c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 4a7d22710441..18c3a024f122 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9e6b8d74e874..c3b778cbbed4 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index a973071d6c96..b9ce0e933256 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b2a6b7e2b8a6..0acd21fd1000 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 7e089dcee2b4..c223f993a69e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e890ef952520..6e8650f76d8e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index f65ae0623d6e..3f1237fee477 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a91b6061bcf7..4dd8a9a9f5a0 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 2d377c3edb02..a9e088808ed3 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index e5eb92da696e..dff4083ae432 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f70328ca9e59..79f271ed7356 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/combineLibrary/Package.swift b/samples/client/petstore/swift5/combineLibrary/Package.swift index 79f6f8188738..96dfff54edf4 100644 --- a/samples/client/petstore/swift5/combineLibrary/Package.swift +++ b/samples/client/petstore/swift5/combineLibrary/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 6ee6f8f43c60..e4cbda9c725d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index cf5a4a61c291..2df909dec9ad 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,8 +8,6 @@ import Foundation import Combine - - open class AnotherFakeAPI { /** To test special tags diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index ccfdc072331f..47510b7781a5 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 @@ -8,8 +8,6 @@ import Foundation import Combine - - open class FakeAPI { /** @@ -343,7 +341,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -362,7 +360,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -482,19 +480,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -549,13 +547,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -577,7 +575,7 @@ open class FakeAPI { - returns: AnyPublisher */ @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promisse in testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { @@ -596,7 +594,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -640,14 +638,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 7d04bd796bb7..6f0401af8885 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,8 +8,6 @@ import Foundation import Combine - - open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 564450e23db9..a1dbbb6af860 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,8 +8,6 @@ import Foundation import Combine - - open class PetAPI { /** Add a new pet to the store @@ -91,8 +89,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -147,8 +145,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -193,8 +191,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -242,8 +240,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -333,14 +331,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -388,14 +386,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -443,14 +441,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 1a4392975b6b..b36a3a30c3a5 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,8 +8,6 @@ import Foundation import Combine - - open class StoreAPI { /** Delete purchase order by ID @@ -45,8 +43,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -61,8 +59,8 @@ open class StoreAPI { - returns: AnyPublisher<[String:Int], Error> */ @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[String:Int], Error> { - return Future<[String:Int], Error>.init { promisse in + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[String: Int], Error> { + return Future<[String: Int], Error>.init { promisse in getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -83,14 +81,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -129,8 +127,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 59fec6d34fe6..3d5694cc935c 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,8 +8,6 @@ import Foundation import Combine - - open class UserAPI { /** Create user @@ -163,8 +161,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -205,8 +203,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -247,11 +245,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -288,8 +286,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 4dc1d70aeb52..32e194f6ee12 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index f171525e4394..627d9adb757e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 6e279679c67a..93ed6b90b376 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,5 +177,3 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } - - diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index 08f1ef334dff..b79e9f5e64d5 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? = nil + var returnedParams: [String: Any]? if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 314f1eff1f9b..02f78ffb4705 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? = nil + var params: [String: Any]? if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 9bf69037bf03..4dd8815847c6 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } -public enum DownloadException : Error { +public enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -30,7 +30,6 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } - open class Response { public let statusCode: Int public let header: [String: String] @@ -44,7 +43,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 28ca8377b889..1af031535967 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 1050d79dbe9d..5ed9f31e2a36 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4d0393b9ba45..ec270da89074 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 1363c96394ba..6c252ed475b2 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 6b8873730c43..e84eb5d65025 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 64f7c6d9db99..d2140933d181 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index ddb669a59045..d1b3b27616ed 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index c4f6e0d488ca..7ab887f3113f 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 7b1d7e32be80..a51ad0dffab1 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3ec00f5ab10d..eb8f7e5e1974 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index af030c3dd626..e2a7d4427a06 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { public var _class: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 0aae748c76b4..00245ca37280 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { public var client: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 198e28b94dd6..492c1228008e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 8ff49b2af23f..7786f8acc5ae 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { public var breed: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index e2d3fa04f94b..9844e7c40e35 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c2c639ba3246..d4029d73f8af 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index a56e1f36389b..789f583e1d77 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 773b53b2cb76..abf3ccffc485 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 83dc1148cfa3..532f1457939a 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index bccd3f9fb178..20bd6d103b3d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 566d71a35ef0..906ddb06fb17 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 80cecab242f2..fe13d302ccbf 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index f0c02de95f7a..4b6037f378ee 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 710e62a9b587..c3deb2f28932 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 450a53b918ca..b61db7d6e716 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 6deb69fcd731..8ab4db44b73a 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 0c9ee2b7b9f4..4d1dafcc2c1f 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index ab0eac0b304e..40c30cc8609c 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 4a7d22710441..18c3a024f122 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9e6b8d74e874..c3b778cbbed4 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index a973071d6c96..b9ce0e933256 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b2a6b7e2b8a6..0acd21fd1000 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 7e089dcee2b4..c223f993a69e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e890ef952520..6e8650f76d8e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index f65ae0623d6e..3f1237fee477 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a91b6061bcf7..4dd8a9a9f5a0 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 2d377c3edb02..a9e088808ed3 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index e5eb92da696e..dff4083ae432 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f70328ca9e59..79f271ed7356 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? 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 fb57e03ff8dd..ad5f58eea436 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId:String = UUID().uuidString + let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil } } -fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -fileprivate class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { - +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ fileprivate class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -fileprivate class FileUploadEncoding: ParameterEncoding { +private class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ fileprivate class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ fileprivate class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/default/Package.swift b/samples/client/petstore/swift5/default/Package.swift index 79f6f8188738..96dfff54edf4 100644 --- a/samples/client/petstore/swift5/default/Package.swift +++ b/samples/client/petstore/swift5/default/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index 6ee6f8f43c60..e4cbda9c725d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index bb3ae7178254..5bbf323f820c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class AnotherFakeAPI { /** To test special tags @@ -17,7 +15,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): 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 d1d81faa335c..134d6aea416a 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 @@ -7,8 +7,6 @@ import Foundation - - open class FakeAPI { /** @@ -16,7 +14,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -51,7 +49,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -86,7 +84,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -121,7 +119,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -156,7 +154,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -192,7 +190,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -231,7 +229,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -281,7 +279,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(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).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -318,7 +316,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -337,7 +335,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -426,7 +424,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -454,19 +452,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -492,7 +490,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -518,13 +516,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -545,7 +543,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -562,7 +560,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -582,7 +580,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -603,14 +601,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index d21c4a49d43d..48cfe7187b9a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,8 +7,6 @@ import Foundation - - open class FakeClassnameTags123API { /** To test class name in snake case @@ -17,7 +15,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 496da91171ac..0552d4a6c16e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class PetAPI { /** Add a new pet to the store @@ -17,7 +15,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -57,7 +55,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -84,8 +82,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -113,7 +111,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -137,8 +135,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -156,7 +154,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +178,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +197,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +224,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +240,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +281,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +309,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +333,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +361,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -387,7 +385,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -415,14 +413,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 3848eda85ad6..a8a83eda39a4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class StoreAPI { /** Delete purchase order by ID @@ -17,7 +15,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -41,8 +39,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -56,7 +54,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -76,14 +74,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -95,7 +93,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,8 +117,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -135,7 +133,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 546166841d9e..505ed1b0c5c9 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class UserAPI { /** Create user @@ -17,7 +15,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -54,7 +52,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -90,7 +88,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -126,7 +124,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -150,8 +148,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -166,7 +164,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -189,8 +187,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -206,7 +204,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -228,11 +226,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -247,7 +245,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -266,8 +264,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -283,7 +281,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 4dc1d70aeb52..32e194f6ee12 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift index f171525e4394..627d9adb757e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 6e279679c67a..93ed6b90b376 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,5 +177,3 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } - - diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index 08f1ef334dff..b79e9f5e64d5 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? = nil + var returnedParams: [String: Any]? if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 314f1eff1f9b..02f78ffb4705 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? = nil + var params: [String: Any]? if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 9bf69037bf03..4dd8815847c6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } -public enum DownloadException : Error { +public enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -30,7 +30,6 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } - open class Response { public let statusCode: Int public let header: [String: String] @@ -44,7 +43,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 28ca8377b889..1af031535967 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 1050d79dbe9d..5ed9f31e2a36 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4d0393b9ba45..ec270da89074 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 1363c96394ba..6c252ed475b2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 6b8873730c43..e84eb5d65025 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 64f7c6d9db99..d2140933d181 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index ddb669a59045..d1b3b27616ed 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index c4f6e0d488ca..7ab887f3113f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 7b1d7e32be80..a51ad0dffab1 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3ec00f5ab10d..eb8f7e5e1974 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index af030c3dd626..e2a7d4427a06 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { public var _class: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 0aae748c76b4..00245ca37280 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { public var client: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 198e28b94dd6..492c1228008e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 8ff49b2af23f..7786f8acc5ae 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { public var breed: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index e2d3fa04f94b..9844e7c40e35 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c2c639ba3246..d4029d73f8af 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index a56e1f36389b..789f583e1d77 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 773b53b2cb76..abf3ccffc485 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 83dc1148cfa3..532f1457939a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index bccd3f9fb178..20bd6d103b3d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 566d71a35ef0..906ddb06fb17 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 80cecab242f2..fe13d302ccbf 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index f0c02de95f7a..4b6037f378ee 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 710e62a9b587..c3deb2f28932 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 450a53b918ca..b61db7d6e716 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 6deb69fcd731..8ab4db44b73a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 0c9ee2b7b9f4..4d1dafcc2c1f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index ab0eac0b304e..40c30cc8609c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 4a7d22710441..18c3a024f122 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9e6b8d74e874..c3b778cbbed4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index a973071d6c96..b9ce0e933256 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b2a6b7e2b8a6..0acd21fd1000 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 7e089dcee2b4..c223f993a69e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e890ef952520..6e8650f76d8e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index f65ae0623d6e..3f1237fee477 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a91b6061bcf7..4dd8a9a9f5a0 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 2d377c3edb02..a9e088808ed3 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index e5eb92da696e..dff4083ae432 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f70328ca9e59..79f271ed7356 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? 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 fb57e03ff8dd..ad5f58eea436 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId:String = UUID().uuidString + let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil } } -fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -fileprivate class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { - +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ fileprivate class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -fileprivate class FileUploadEncoding: ParameterEncoding { +private class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ fileprivate class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ fileprivate class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/nonPublicApi/Package.swift b/samples/client/petstore/swift5/nonPublicApi/Package.swift index 79f6f8188738..96dfff54edf4 100644 --- a/samples/client/petstore/swift5/nonPublicApi/Package.swift +++ b/samples/client/petstore/swift5/nonPublicApi/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 93b30800826e..8641eb7ebf77 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation internal struct APIHelper { - internal static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + internal static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ internal struct APIHelper { return destination } - internal static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + internal static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - internal static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + internal static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ internal struct APIHelper { } internal static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - internal static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + internal static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ internal struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift index 8f6a50857cc7..743d9aa443a1 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation internal class PetstoreClientAPI { internal static var basePath = "http://petstore.swagger.io:80/v2" internal static var credential: URLCredential? - internal static var customHeaders: [String:String] = [:] + internal static var customHeaders: [String: String] = [:] internal static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() internal static var apiResponseQueue: DispatchQueue = .main } internal class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - internal let parameters: [String:Any]? + var headers: [String: String] + internal let parameters: [String: Any]? internal let isBody: Bool internal let method: String internal let URLString: String @@ -25,9 +25,9 @@ internal class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - internal var onProgressReady: ((Progress) -> ())? + internal var onProgressReady: ((Progress) -> Void)? - required internal init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required internal init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ internal class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - internal func addHeaders(_ aHeaders:[String:String]) { + internal func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ internal class RequestBuilder { internal protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 81f23f107ad6..174e6c12aedd 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,8 +7,6 @@ import Foundation - - internal class AnotherFakeAPI { /** To test special tags @@ -17,7 +15,7 @@ internal class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + internal class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): 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 e52322c01c51..ab1b8f092475 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 @@ -7,8 +7,6 @@ import Foundation - - internal class FakeAPI { /** @@ -16,7 +14,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + internal class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -51,7 +49,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -86,7 +84,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + internal class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -121,7 +119,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + internal class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -156,7 +154,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -192,7 +190,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -231,7 +229,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + internal class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -281,7 +279,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - 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, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + 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, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(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).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -318,7 +316,7 @@ internal class FakeAPI { internal class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -337,7 +335,7 @@ internal class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -426,7 +424,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -454,19 +452,19 @@ internal class FakeAPI { internal class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -492,7 +490,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -518,13 +516,13 @@ internal class FakeAPI { internal class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -545,7 +543,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -562,7 +560,7 @@ internal class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - internal class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + internal class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -582,7 +580,7 @@ internal class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -603,14 +601,14 @@ internal class FakeAPI { internal class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 969fc92e025d..548c5fb35236 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,8 +7,6 @@ import Foundation - - internal class FakeClassnameTags123API { /** To test class name in snake case @@ -17,7 +15,7 @@ internal class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + internal class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 07228f009cd8..4802f256c100 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,8 +7,6 @@ import Foundation - - internal class PetAPI { /** Add a new pet to the store @@ -17,7 +15,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -57,7 +55,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -84,8 +82,8 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -113,7 +111,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + internal class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -137,8 +135,8 @@ internal class PetAPI { internal class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -156,7 +154,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +178,8 @@ internal class PetAPI { internal class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +197,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + internal class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +224,8 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +240,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +281,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +309,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +333,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +361,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -387,7 +385,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -415,14 +413,14 @@ internal class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 528a19a9032b..f1e423111d09 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,8 +7,6 @@ import Foundation - - internal class StoreAPI { /** Delete purchase order by ID @@ -17,7 +15,7 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -41,8 +39,8 @@ internal class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -56,7 +54,7 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + internal class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -76,14 +74,14 @@ internal class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - internal class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + internal class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -95,7 +93,7 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + internal class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,8 +117,8 @@ internal class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -135,7 +133,7 @@ internal class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + internal class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 298a7fee4850..c8d714e89916 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,8 +7,6 @@ import Foundation - - internal class UserAPI { /** Create user @@ -17,7 +15,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -54,7 +52,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -90,7 +88,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -126,7 +124,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -150,8 +148,8 @@ internal class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -166,7 +164,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + internal class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -189,8 +187,8 @@ internal class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -206,7 +204,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + internal class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -228,11 +226,11 @@ internal class UserAPI { internal class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -247,7 +245,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -266,8 +264,8 @@ internal class UserAPI { internal class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -283,7 +281,7 @@ internal class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - internal class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + internal class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index cced20209751..f14bd48aced6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ internal class CodableHelper { internal class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 400d8bd126c7..4dfbe7b0cde7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation internal class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") internal static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift index f7550a684a7a..e5511b3aa373 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - internal mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + internal mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - internal mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + internal mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - internal mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + internal mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - internal mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + internal mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - internal func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + internal func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - internal func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + internal func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - internal func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + internal func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,5 +177,3 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } - - diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index 332e960ac68c..6b69f3b1bd50 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ internal struct JSONDataEncoding { } internal static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? = nil + var returnedParams: [String: Any]? if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 47329d53ee41..7d8f433dfea7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation internal class JSONEncodingHelper { - internal class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? = nil + internal class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ internal class JSONEncodingHelper { } internal class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? = nil + var params: [String: Any]? if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ internal class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift index 8a973c8340e0..435d9ce447a0 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -internal enum ErrorResponse : Error { +internal enum ErrorResponse: Error { case error(Int, Data?, Error) } -internal enum DownloadException : Error { +internal enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -30,7 +30,6 @@ internal enum DecodableRequestBuilderError: Error { case generalError(Error) } - internal class Response { internal let statusCode: Int internal let header: [String: String] @@ -44,7 +43,7 @@ internal class Response { internal convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index c8876320f47a..b4d5ae6faf93 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +internal struct AdditionalPropertiesClass: Codable { -internal struct AdditionalPropertiesClass: Codable { + internal var mapString: [String: String]? + internal var mapMapString: [String: [String: String]]? - - internal var mapString: [String:String]? - internal var mapMapString: [String:[String:String]]? - - internal init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + internal init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 20d157f4ebcb..ada7f86de509 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Animal: Codable { - +internal struct Animal: Codable { internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index 9c570350859f..3ebe9e9a5dea 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - internal typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 88b4b69c1668..b60d8999b4b2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct ApiResponse: Codable { - +internal struct ApiResponse: Codable { internal var code: Int? internal var type: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 3e8bc3da83b1..67371b816b30 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct ArrayOfArrayOfNumberOnly: Codable { - +internal struct ArrayOfArrayOfNumberOnly: Codable { internal var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ internal struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 8e92c78e4da3..2c7047eac4b0 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct ArrayOfNumberOnly: Codable { - +internal struct ArrayOfNumberOnly: Codable { internal var arrayNumber: [Double]? @@ -17,7 +15,7 @@ internal struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index d7916cf20b9c..9c3a3a9f5e1f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct ArrayTest: Codable { - +internal struct ArrayTest: Codable { internal var arrayOfString: [String]? internal var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ internal struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 17221a54edb6..965ec5aefba3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Capitalization: Codable { - +internal struct Capitalization: Codable { internal var smallCamel: String? internal var capitalCamel: String? @@ -28,7 +26,7 @@ internal struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 28292469ddae..8a603dee5f1f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Cat: Codable { - +internal struct Cat: Codable { internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index cdcb1aa14b57..45b7dbb26dcf 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct CatAllOf: Codable { - +internal struct CatAllOf: Codable { internal var declawed: Bool? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 9b061937e091..849bf788dfb3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Category: Codable { - +internal struct Category: Codable { internal var id: Int64? internal var name: String = "default-name" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 034cbadc8dd6..0f1bc19fe595 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -internal struct ClassModel: Codable { - +internal struct ClassModel: Codable { internal var _class: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index e33907ca3a3c..ddee836043fa 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Client: Codable { - +internal struct Client: Codable { internal var client: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 3d45b8ac7a13..6b5250de4a4a 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Dog: Codable { - +internal struct Dog: Codable { internal var className: String internal var color: String? = "red" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 6fb9a0505161..ef3ff7f1d78b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct DogAllOf: Codable { - +internal struct DogAllOf: Codable { internal var breed: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 8aa9c2bd58d2..bb9f64cfb438 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct EnumArrays: Codable { - +internal struct EnumArrays: Codable { internal enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ internal struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 07dfc16a69f2..71fd29e0d2a5 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - internal enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 4081beae4c0a..421aa5436b04 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct EnumTest: Codable { - +internal struct EnumTest: Codable { internal enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -43,7 +41,7 @@ internal struct EnumTest: Codable { self.outerEnum = outerEnum } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 166138041ecf..632402fb9e03 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -internal struct File: Codable { - +internal struct File: Codable { /** Test capitalization */ internal var sourceURI: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 2245e94bcc90..e478e6c4b7d1 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct FileSchemaTestClass: Codable { - +internal struct FileSchemaTestClass: Codable { internal var file: File? internal var files: [File]? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 30b11efb2e19..23395c93b569 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct FormatTest: Codable { - +internal struct FormatTest: Codable { internal var integer: Int? internal var int32: Int? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index d51b4421dfe6..831963ba2ed2 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct HasOnlyReadOnly: Codable { - +internal struct HasOnlyReadOnly: Codable { internal var bar: String? internal var foo: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 0a76cba0ed92..c5960de21513 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct List: Codable { - +internal struct List: Codable { internal var _123list: String? @@ -17,7 +15,7 @@ internal struct List: Codable { self._123list = _123list } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index b0a860092bc6..db4f8f436aa5 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -internal struct MapTest: Codable { - +internal struct MapTest: Codable { internal enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - internal var mapMapOfString: [String:[String:String]]? - internal var mapOfEnumString: [String:String]? - internal var directMap: [String:Bool]? + internal var mapMapOfString: [String: [String: String]]? + internal var mapOfEnumString: [String: String]? + internal var directMap: [String: Bool]? internal var indirectMap: StringBooleanMap? - internal init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + internal init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c6fa4baaecd7..c71bb9256b0a 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable { internal var uuid: UUID? internal var dateTime: Date? - internal var map: [String:Animal]? + internal var map: [String: Animal]? - internal init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + internal init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 2a81b0ac9273..5d31a885f751 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -internal struct Model200Response: Codable { - +internal struct Model200Response: Codable { internal var name: Int? internal var _class: String? @@ -19,7 +18,7 @@ internal struct Model200Response: Codable { self._class = _class } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 5c7df2148768..2aa8fb1524c3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -internal struct Name: Codable { - +internal struct Name: Codable { internal var name: Int internal var snakeCase: Int? @@ -23,7 +22,7 @@ internal struct Name: Codable { self._123number = _123number } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 3473e7016447..49d73706e398 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct NumberOnly: Codable { - +internal struct NumberOnly: Codable { internal var justNumber: Double? @@ -17,7 +15,7 @@ internal struct NumberOnly: Codable { self.justNumber = justNumber } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index b6fd07e148b5..dcefb40efa2b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Order: Codable { - +internal struct Order: Codable { internal enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 592f9a849ce3..c61c2c4a4620 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct OuterComposite: Codable { - +internal struct OuterComposite: Codable { internal var myNumber: Double? internal var myString: String? @@ -21,7 +19,7 @@ internal struct OuterComposite: Codable { self.myBoolean = myBoolean } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index ab1397d4f31d..e0cdcbea0558 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - internal enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 0cf0f0d3b4b5..b71700544d06 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Pet: Codable { - +internal struct Pet: Codable { internal enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 8792cf4aa754..d02c6cc5fd9f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct ReadOnlyFirst: Codable { - +internal struct ReadOnlyFirst: Codable { internal var bar: String? internal var baz: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 82b73db4b37e..95a18b571ade 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -internal struct Return: Codable { - +internal struct Return: Codable { internal var _return: Int? @@ -17,7 +16,7 @@ internal struct Return: Codable { self._return = _return } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e98a8fd7955c..b6ac3651f0e7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct SpecialModelName: Codable { - +internal struct SpecialModelName: Codable { internal var specialPropertyName: Int64? @@ -17,7 +15,7 @@ internal struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index d1afe6732a46..dc3d00e13014 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +internal struct StringBooleanMap: Codable { -internal struct StringBooleanMap: Codable { - - - - internal var additionalProperties: [String:Bool] = [:] + internal var additionalProperties: [String: Bool] = [:] internal subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ internal struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 923acc9b1f69..1e4de951fb2c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct Tag: Codable { - +internal struct Tag: Codable { internal var id: Int64? internal var name: String? diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index e78ae839f503..83908bb4fc94 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct TypeHolderDefault: Codable { - +internal struct TypeHolderDefault: Codable { internal var stringItem: String = "what" internal var numberItem: Double @@ -25,7 +23,7 @@ internal struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index c829014f0d44..3e2c6193aa3e 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct TypeHolderExample: Codable { - +internal struct TypeHolderExample: Codable { internal var stringItem: String internal var numberItem: Double @@ -25,7 +23,7 @@ internal struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - internal enum CodingKeys: String, CodingKey, CaseIterable { + internal enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift index c2865a579220..ada8a7f82d96 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -internal struct User: Codable { - +internal struct User: Codable { internal var id: Int64? internal var username: String? 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 9ddbca74f945..b8cfe114dc55 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() internal class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ internal class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ internal var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required internal init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + + required internal init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ internal class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - internal func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { - + internal func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId:String = UUID().uuidString + let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ internal class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ internal class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ internal class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } -internal class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +internal class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ internal class URLSessionDecodableRequestBuilder: URLSessionRequest switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ internal class URLSessionDecodableRequestBuilder: URLSessionRequest } } -fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ internal protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -fileprivate class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { - +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ fileprivate class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -fileprivate class FileUploadEncoding: ParameterEncoding { +private class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ fileprivate class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ fileprivate class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/objcCompatible/Package.swift b/samples/client/petstore/swift5/objcCompatible/Package.swift index 79f6f8188738..96dfff54edf4 100644 --- a/samples/client/petstore/swift5/objcCompatible/Package.swift +++ b/samples/client/petstore/swift5/objcCompatible/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift index 6ee6f8f43c60..e4cbda9c725d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 41731036ab60..2e9ad96a66b5 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc open class AnotherFakeAPI : NSObject { +@objc open class AnotherFakeAPI: NSObject { /** To test special tags @@ -17,7 +15,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): 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 fc51b0022277..6483ab29bcc3 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 @@ -7,16 +7,14 @@ import Foundation - - -@objc open class FakeAPI : NSObject { +@objc open class FakeAPI: NSObject { /** - parameter body: (body) Input boolean as post body (optional) - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -51,7 +49,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -86,7 +84,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -121,7 +119,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -156,7 +154,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -192,7 +190,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -231,7 +229,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -281,7 +279,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(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).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -318,7 +316,7 @@ import Foundation open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -337,7 +335,7 @@ import Foundation let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -426,7 +424,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -454,19 +452,19 @@ import Foundation open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -492,7 +490,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -518,13 +516,13 @@ import Foundation open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -545,7 +543,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -562,7 +560,7 @@ import Foundation - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -582,7 +580,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -603,14 +601,14 @@ import Foundation open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 3793f6dc4128..b9cfc75eeb4c 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc open class FakeClassnameTags123API : NSObject { +@objc open class FakeClassnameTags123API: NSObject { /** To test class name in snake case @@ -17,7 +15,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index b75d1fa8deda..e1708decd35b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc open class PetAPI : NSObject { +@objc open class PetAPI: NSObject { /** Add a new pet to the store @@ -17,7 +15,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -57,7 +55,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -84,8 +82,8 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -113,7 +111,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -137,8 +135,8 @@ import Foundation open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -156,7 +154,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +178,8 @@ import Foundation open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +197,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +224,8 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +240,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +281,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +309,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +333,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +361,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -387,7 +385,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -415,14 +413,14 @@ import Foundation let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index cc15cd3ae88c..a19d12c7d24b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc open class StoreAPI : NSObject { +@objc open class StoreAPI: NSObject { /** Delete purchase order by ID @@ -17,7 +15,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -41,8 +39,8 @@ import Foundation let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -56,7 +54,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -76,14 +74,14 @@ import Foundation - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -95,7 +93,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,8 +117,8 @@ import Foundation let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -135,7 +133,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 6e0e10bc7b22..4dfe4da1a021 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc open class UserAPI : NSObject { +@objc open class UserAPI: NSObject { /** Create user @@ -17,7 +15,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -54,7 +52,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -90,7 +88,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -126,7 +124,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -150,8 +148,8 @@ import Foundation let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -166,7 +164,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -189,8 +187,8 @@ import Foundation let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -206,7 +204,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -228,11 +226,11 @@ import Foundation open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -247,7 +245,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -266,8 +264,8 @@ import Foundation open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -283,7 +281,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 4dc1d70aeb52..32e194f6ee12 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift index f171525e4394..627d9adb757e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 6e279679c67a..93ed6b90b376 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,5 +177,3 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } - - diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index 08f1ef334dff..b79e9f5e64d5 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? = nil + var returnedParams: [String: Any]? if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 314f1eff1f9b..02f78ffb4705 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? = nil + var params: [String: Any]? if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index 9bf69037bf03..4dd8815847c6 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } -public enum DownloadException : Error { +public enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -30,7 +30,6 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } - open class Response { public let statusCode: Int public let header: [String: String] @@ -44,7 +43,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index d4e1b3697e71..e184d7691799 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +@objc public class AdditionalPropertiesClass: NSObject, Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? -@objc public class AdditionalPropertiesClass: NSObject, Codable { - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index f34ba3bb63e7..88152934da2b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Animal: NSObject, Codable { +@objc public class Animal: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -19,7 +17,7 @@ import Foundation self.color = color } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _className = "className" case color } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index d9a7fae21446..d0fcd4368854 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class ApiResponse: NSObject, Codable { +@objc public class ApiResponse: NSObject, Codable { public var code: Int? public var codeNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index e57e63b6ed28..9e3f3aba246a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable { +@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ import Foundation self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e087329fdc44..d287cc1563aa 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class ArrayOfNumberOnly: NSObject, Codable { +@objc public class ArrayOfNumberOnly: NSObject, Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ import Foundation self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index c7e6b0b27a4b..dcc3e9c3dd51 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class ArrayTest: NSObject, Codable { +@objc public class ArrayTest: NSObject, Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ import Foundation self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index e472eaaa7916..80a5667445f2 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Capitalization: NSObject, Codable { +@objc public class Capitalization: NSObject, Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ import Foundation self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 1b19800ae3c3..78de5a909f54 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Cat: NSObject, Codable { +@objc public class Cat: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -26,7 +24,7 @@ import Foundation self.declawed = declawed } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _className = "className" case color case declawed diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8758762c40bf..ef8cec45aff1 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class CatAllOf: NSObject, Codable { +@objc public class CatAllOf: NSObject, Codable { public var declawed: Bool? public var declawedNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index df7771efc457..0610c10c982f 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Category: NSObject, Codable { +@objc public class Category: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -24,7 +22,7 @@ import Foundation self.name = name } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case name } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index c221ccf2a0de..4197ffcaed6c 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -@objc public class ClassModel: NSObject, Codable { +@objc public class ClassModel: NSObject, Codable { public var _class: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 5aea86fbb06e..517dbbba2ec2 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Client: NSObject, Codable { +@objc public class Client: NSObject, Codable { public var client: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 464f0c7ae4e7..37733cd1f3be 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Dog: NSObject, Codable { +@objc public class Dog: NSObject, Codable { public var _className: String public var color: String? = "red" @@ -21,7 +19,7 @@ import Foundation self.breed = breed } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _className = "className" case color case breed diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index efcd880f10b3..73fd1822725c 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class DogAllOf: NSObject, Codable { +@objc public class DogAllOf: NSObject, Codable { public var breed: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 3c1c26139314..034a58c6c0eb 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class EnumArrays: NSObject, Codable { +@objc public class EnumArrays: NSObject, Codable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ import Foundation self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c2c639ba3246..d4029d73f8af 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 60b754914d42..ce3a03006097 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class EnumTest: NSObject, Codable { +@objc public class EnumTest: NSObject, Codable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -43,7 +41,7 @@ import Foundation self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 120d5bb78797..7a320c177d38 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -9,7 +9,7 @@ import Foundation /** Must be named `File` for test. */ -@objc public class File: NSObject, Codable { +@objc public class File: NSObject, Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index e60109a85334..a6437b4fe901 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class FileSchemaTestClass: NSObject, Codable { +@objc public class FileSchemaTestClass: NSObject, Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 664481c02fc4..df2c46d3757b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class FormatTest: NSObject, Codable { +@objc public class FormatTest: NSObject, Codable { public var integer: Int? public var integerNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 974726b3e65d..b9f5b39117d7 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class HasOnlyReadOnly: NSObject, Codable { +@objc public class HasOnlyReadOnly: NSObject, Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 4942b7502244..826dc9e27f2b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class List: NSObject, Codable { +@objc public class List: NSObject, Codable { public var _123list: String? @@ -17,7 +15,7 @@ import Foundation self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 2acd08f46a45..2b97660b80e8 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - - -@objc public class MapTest: NSObject, Codable { +@objc public class MapTest: NSObject, Codable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 3ecb79bf9f43..e10adad0a7e1 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - - -@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { +@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 031badf4be9e..1c5410f61dde 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model name starting with number */ -@objc public class Model200Response: NSObject, Codable { +@objc public class Model200Response: NSObject, Codable { public var name: Int? public var nameNum: NSNumber? { @@ -24,7 +24,7 @@ import Foundation self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index c863b854d468..06f8a2f81a3a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing model name same as property name */ -@objc public class Name: NSObject, Codable { +@objc public class Name: NSObject, Codable { public var name: Int public var snakeCase: Int? @@ -33,7 +33,7 @@ import Foundation self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 1db3ace43047..3bd9859378d8 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class NumberOnly: NSObject, Codable { +@objc public class NumberOnly: NSObject, Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ import Foundation self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 5fdd493dbedb..586a4c2d55a8 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Order: NSObject, Codable { +@objc public class Order: NSObject, Codable { public enum Status: String, Codable, CaseIterable { case placed = "placed" @@ -53,7 +51,7 @@ import Foundation self.complete = complete } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case petId case quantity diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 0d1791d3fa8d..434111678de7 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class OuterComposite: NSObject, Codable { +@objc public class OuterComposite: NSObject, Codable { public var myNumber: Double? public var myString: String? @@ -26,7 +24,7 @@ import Foundation self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9e6b8d74e874..c3b778cbbed4 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 29d4e3d9e37a..d84079a2b48d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Pet: NSObject, Codable { +@objc public class Pet: NSObject, Codable { public enum Status: String, Codable, CaseIterable { case available = "available" @@ -38,7 +36,7 @@ import Foundation self.status = status } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case category case name diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 2c806ac6d756..d1252433b2d8 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class ReadOnlyFirst: NSObject, Codable { +@objc public class ReadOnlyFirst: NSObject, Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 948f6f4d3846..4b10ac18cf0d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -9,7 +9,7 @@ import Foundation /** Model for testing reserved words */ -@objc public class Return: NSObject, Codable { +@objc public class Return: NSObject, Codable { public var _return: Int? public var _returnNum: NSNumber? { @@ -22,7 +22,7 @@ import Foundation self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index c01c4065998b..85e33352531d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class SpecialModelName: NSObject, Codable { +@objc public class SpecialModelName: NSObject, Codable { public var specialPropertyName: Int64? public var specialPropertyNameNum: NSNumber? { @@ -22,7 +20,7 @@ import Foundation self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3116d99bff0c..ffe9730a6fe4 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +@objc public class StringBooleanMap: NSObject, Codable { - -@objc public class StringBooleanMap: NSObject, Codable { - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ import Foundation additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 1bd7489826dd..88583be7f5dd 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class Tag: NSObject, Codable { +@objc public class Tag: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -24,7 +22,7 @@ import Foundation self.name = name } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case name } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 273b7b31aefd..6d51f44540c0 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class TypeHolderDefault: NSObject, Codable { +@objc public class TypeHolderDefault: NSObject, Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ import Foundation self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 3cb1929d4394..40e3a41c34d9 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class TypeHolderExample: NSObject, Codable { +@objc public class TypeHolderExample: NSObject, Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ import Foundation self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift index eb8ec0552741..7dc3cc5954d6 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - - -@objc public class User: NSObject, Codable { +@objc public class User: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { @@ -42,7 +40,7 @@ import Foundation self.userStatus = userStatus } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case username case firstName 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 fb57e03ff8dd..ad5f58eea436 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId:String = UUID().uuidString + let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil } } -fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -fileprivate class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { - +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ fileprivate class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -fileprivate class FileUploadEncoding: ParameterEncoding { +private class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ fileprivate class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ fileprivate class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/promisekitLibrary/Package.swift b/samples/client/petstore/swift5/promisekitLibrary/Package.swift index 10dac4053846..4445c9794907 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/Package.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/Package.swift @@ -14,19 +14,19 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.12.0"), + .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.12.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "PetstoreClient", - dependencies: ["PromiseKit", ], + dependencies: ["PromiseKit" ], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 6ee6f8f43c60..e4cbda9c725d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ffce4d7c4e81..c3a97ff074c1 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,8 +8,6 @@ import Foundation import PromiseKit - - open class AnotherFakeAPI { /** To test special tags 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 47b6ec5f196f..80153ba634d3 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 @@ -8,8 +8,6 @@ import Foundation import PromiseKit - - open class FakeAPI { /** @@ -203,7 +201,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testBodyWithQueryParams( query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testBodyWithQueryParams( query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { @@ -296,7 +294,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testEndpointParametersWithRequestBuilder(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).execute(apiResponseQueue) { result -> Void in switch result { @@ -335,7 +333,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -354,7 +352,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -443,7 +441,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { @@ -473,19 +471,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -511,7 +509,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { @@ -539,13 +537,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -566,7 +564,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testInlineAdditionalProperties( param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testInlineAdditionalProperties( param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { @@ -585,7 +583,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -605,7 +603,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func testJsonFormData( param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func testJsonFormData( param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { @@ -628,14 +626,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index e749c654de5c..3a05f8eaf60e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,8 +8,6 @@ import Foundation import PromiseKit - - open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 621e228787b7..4514fc8f107b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,8 +8,6 @@ import Foundation import PromiseKit - - open class PetAPI { /** Add a new pet to the store @@ -60,7 +58,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func deletePet( petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func deletePet( petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { @@ -89,8 +87,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -144,8 +142,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -189,8 +187,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -237,8 +235,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -296,7 +294,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { @@ -326,14 +324,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -350,7 +348,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { @@ -380,14 +378,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -404,7 +402,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { @@ -434,14 +432,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 9bb66f3699f7..20fc8a1468c7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,8 +8,6 @@ import Foundation import PromiseKit - - open class StoreAPI { /** Delete purchase order by ID @@ -44,8 +42,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -59,8 +57,8 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise<[String:Int]> */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise<[String:Int]> { - let deferred = Promise<[String:Int]>.pending() + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise<[String: Int]> { + let deferred = Promise<[String: Int]>.pending() getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -81,14 +79,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -126,8 +124,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 237961c96a08..89c48c3b28f8 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,8 +8,6 @@ import Foundation import PromiseKit - - open class UserAPI { /** Create user @@ -159,8 +157,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -200,8 +198,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -217,7 +215,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func loginUser( username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func loginUser( username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { @@ -241,11 +239,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -281,8 +279,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -298,7 +296,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise */ - open class func updateUser( username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { + open class func updateUser( username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise { let deferred = Promise.pending() updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 4dc1d70aeb52..32e194f6ee12 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index f171525e4394..627d9adb757e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 5b98ba296730..736702ea5dd9 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -109,24 +109,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -136,7 +136,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -148,8 +148,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -158,8 +158,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -180,7 +180,7 @@ extension HTTPURLResponse { } extension RequestBuilder { - public func execute() -> Promise> { + public func execute() -> Promise> { let deferred = Promise>.pending() self.execute { result in switch result { diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index 08f1ef334dff..b79e9f5e64d5 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? = nil + var returnedParams: [String: Any]? if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 314f1eff1f9b..02f78ffb4705 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? = nil + var params: [String: Any]? if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 9bf69037bf03..4dd8815847c6 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } -public enum DownloadException : Error { +public enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -30,7 +30,6 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } - open class Response { public let statusCode: Int public let header: [String: String] @@ -44,7 +43,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 28ca8377b889..1af031535967 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 1050d79dbe9d..5ed9f31e2a36 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4d0393b9ba45..ec270da89074 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 1363c96394ba..6c252ed475b2 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 6b8873730c43..e84eb5d65025 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 64f7c6d9db99..d2140933d181 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index ddb669a59045..d1b3b27616ed 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index c4f6e0d488ca..7ab887f3113f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 7b1d7e32be80..a51ad0dffab1 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3ec00f5ab10d..eb8f7e5e1974 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index af030c3dd626..e2a7d4427a06 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { public var _class: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 0aae748c76b4..00245ca37280 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { public var client: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 198e28b94dd6..492c1228008e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 8ff49b2af23f..7786f8acc5ae 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { public var breed: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index e2d3fa04f94b..9844e7c40e35 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c2c639ba3246..d4029d73f8af 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index a56e1f36389b..789f583e1d77 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 773b53b2cb76..abf3ccffc485 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 83dc1148cfa3..532f1457939a 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index bccd3f9fb178..20bd6d103b3d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 566d71a35ef0..906ddb06fb17 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 80cecab242f2..fe13d302ccbf 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index f0c02de95f7a..4b6037f378ee 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 710e62a9b587..c3deb2f28932 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 450a53b918ca..b61db7d6e716 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 6deb69fcd731..8ab4db44b73a 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 0c9ee2b7b9f4..4d1dafcc2c1f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index ab0eac0b304e..40c30cc8609c 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 4a7d22710441..18c3a024f122 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9e6b8d74e874..c3b778cbbed4 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index a973071d6c96..b9ce0e933256 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b2a6b7e2b8a6..0acd21fd1000 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 7e089dcee2b4..c223f993a69e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e890ef952520..6e8650f76d8e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index f65ae0623d6e..3f1237fee477 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a91b6061bcf7..4dd8a9a9f5a0 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 2d377c3edb02..a9e088808ed3 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index e5eb92da696e..dff4083ae432 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f70328ca9e59..79f271ed7356 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? 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 fb57e03ff8dd..ad5f58eea436 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId:String = UUID().uuidString + let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil } } -fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -fileprivate class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { - +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ fileprivate class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -fileprivate class FileUploadEncoding: ParameterEncoding { +private class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ fileprivate class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ fileprivate class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/resultLibrary/Package.swift b/samples/client/petstore/swift5/resultLibrary/Package.swift index 79f6f8188738..96dfff54edf4 100644 --- a/samples/client/petstore/swift5/resultLibrary/Package.swift +++ b/samples/client/petstore/swift5/resultLibrary/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 6ee6f8f43c60..e4cbda9c725d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 49ba99122021..869f1ccd251a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class AnotherFakeAPI { /** To test special tags 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 bc862e4651dd..2764fb314ab0 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 @@ -7,8 +7,6 @@ import Foundation - - open class FakeAPI { /** @@ -318,7 +316,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -337,7 +335,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -454,19 +452,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -518,13 +516,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -545,7 +543,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -562,7 +560,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -603,14 +601,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 86552eb286bc..5f21b82aa35a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,8 +7,6 @@ import Foundation - - open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0fe4f4c252a9..a9c5c89eb1c6 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class PetAPI { /** Add a new pet to the store @@ -84,8 +82,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -137,8 +135,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -180,8 +178,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -226,8 +224,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -311,14 +309,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -363,14 +361,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -415,14 +413,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 9c94c3098388..f67d192fa914 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class StoreAPI { /** Delete purchase order by ID @@ -41,8 +39,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -56,7 +54,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result<[String:Int], Error>) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result<[String: Int], Error>) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -76,14 +74,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -119,8 +117,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 52a63c48d1e7..930d55d9428e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class UserAPI { /** Create user @@ -150,8 +148,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -189,8 +187,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -228,11 +226,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -266,8 +264,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 4dc1d70aeb52..32e194f6ee12 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index f171525e4394..627d9adb757e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 6e279679c67a..93ed6b90b376 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,5 +177,3 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } - - diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index 08f1ef334dff..b79e9f5e64d5 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? = nil + var returnedParams: [String: Any]? if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 314f1eff1f9b..02f78ffb4705 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? = nil + var params: [String: Any]? if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 9bf69037bf03..4dd8815847c6 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } -public enum DownloadException : Error { +public enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -30,7 +30,6 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } - open class Response { public let statusCode: Int public let header: [String: String] @@ -44,7 +43,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 28ca8377b889..1af031535967 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 1050d79dbe9d..5ed9f31e2a36 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4d0393b9ba45..ec270da89074 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 1363c96394ba..6c252ed475b2 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 6b8873730c43..e84eb5d65025 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 64f7c6d9db99..d2140933d181 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index ddb669a59045..d1b3b27616ed 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index c4f6e0d488ca..7ab887f3113f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 7b1d7e32be80..a51ad0dffab1 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3ec00f5ab10d..eb8f7e5e1974 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index af030c3dd626..e2a7d4427a06 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { public var _class: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 0aae748c76b4..00245ca37280 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { public var client: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 198e28b94dd6..492c1228008e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 8ff49b2af23f..7786f8acc5ae 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { public var breed: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index e2d3fa04f94b..9844e7c40e35 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c2c639ba3246..d4029d73f8af 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index a56e1f36389b..789f583e1d77 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 773b53b2cb76..abf3ccffc485 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 83dc1148cfa3..532f1457939a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index bccd3f9fb178..20bd6d103b3d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 566d71a35ef0..906ddb06fb17 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 80cecab242f2..fe13d302ccbf 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index f0c02de95f7a..4b6037f378ee 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 710e62a9b587..c3deb2f28932 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 450a53b918ca..b61db7d6e716 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 6deb69fcd731..8ab4db44b73a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 0c9ee2b7b9f4..4d1dafcc2c1f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index ab0eac0b304e..40c30cc8609c 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 4a7d22710441..18c3a024f122 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9e6b8d74e874..c3b778cbbed4 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index a973071d6c96..b9ce0e933256 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b2a6b7e2b8a6..0acd21fd1000 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 7e089dcee2b4..c223f993a69e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e890ef952520..6e8650f76d8e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index f65ae0623d6e..3f1237fee477 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a91b6061bcf7..4dd8a9a9f5a0 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 2d377c3edb02..a9e088808ed3 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index e5eb92da696e..dff4083ae432 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f70328ca9e59..79f271ed7356 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? 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 fb57e03ff8dd..ad5f58eea436 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId:String = UUID().uuidString + let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil } } -fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -fileprivate class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { - +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ fileprivate class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -fileprivate class FileUploadEncoding: ParameterEncoding { +private class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ fileprivate class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ fileprivate class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/rxswiftLibrary/Package.swift b/samples/client/petstore/swift5/rxswiftLibrary/Package.swift index 4b20458197f3..24f9a6c99ae5 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/Package.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/Package.swift @@ -14,11 +14,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0"), + .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -27,6 +27,6 @@ let package = Package( name: "PetstoreClient", dependencies: ["RxSwift"], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 6ee6f8f43c60..e4cbda9c725d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 4090e37b32c9..792371b38421 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -8,8 +8,6 @@ import Foundation import RxSwift - - open class AnotherFakeAPI { /** To test special tags 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 fa3d09834ff0..3e9b32438c82 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 @@ -8,8 +8,6 @@ import Foundation import RxSwift - - open class FakeAPI { /** @@ -351,7 +349,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -370,7 +368,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -491,19 +489,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -559,13 +557,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -586,7 +584,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Observable */ - open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { @@ -607,7 +605,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -652,14 +650,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 1353f91b278f..989a914f3795 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -8,8 +8,6 @@ import Foundation import RxSwift - - open class FakeClassnameTags123API { /** To test class name in snake case diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 6abd80254ddd..42bafcffce16 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -8,8 +8,6 @@ import Foundation import RxSwift - - open class PetAPI { /** Add a new pet to the store @@ -93,8 +91,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -150,8 +148,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -197,8 +195,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -247,8 +245,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -340,14 +338,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -396,14 +394,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -452,14 +450,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f5c974ba3824..dea3933433cf 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -8,8 +8,6 @@ import Foundation import RxSwift - - open class StoreAPI { /** Delete purchase order by ID @@ -46,8 +44,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -61,7 +59,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Observable<[String:Int]> */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[String:Int]> { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[String: Int]> { return Observable.create { observer -> Disposable in getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { @@ -85,14 +83,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -132,8 +130,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 2228363cfccd..3447ea28c0ed 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -8,8 +8,6 @@ import Foundation import RxSwift - - open class UserAPI { /** Create user @@ -167,8 +165,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -210,8 +208,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -253,11 +251,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -295,8 +293,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 4dc1d70aeb52..32e194f6ee12 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index f171525e4394..627d9adb757e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 6e279679c67a..93ed6b90b376 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,5 +177,3 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } - - diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index 08f1ef334dff..b79e9f5e64d5 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? = nil + var returnedParams: [String: Any]? if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 314f1eff1f9b..02f78ffb4705 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? = nil + var params: [String: Any]? if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 9bf69037bf03..4dd8815847c6 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } -public enum DownloadException : Error { +public enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -30,7 +30,6 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } - open class Response { public let statusCode: Int public let header: [String: String] @@ -44,7 +43,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 28ca8377b889..1af031535967 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 1050d79dbe9d..5ed9f31e2a36 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4d0393b9ba45..ec270da89074 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 1363c96394ba..6c252ed475b2 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 6b8873730c43..e84eb5d65025 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 64f7c6d9db99..d2140933d181 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index ddb669a59045..d1b3b27616ed 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index c4f6e0d488ca..7ab887f3113f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 7b1d7e32be80..a51ad0dffab1 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3ec00f5ab10d..eb8f7e5e1974 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index af030c3dd626..e2a7d4427a06 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { public var _class: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 0aae748c76b4..00245ca37280 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { public var client: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 198e28b94dd6..492c1228008e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 8ff49b2af23f..7786f8acc5ae 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { public var breed: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index e2d3fa04f94b..9844e7c40e35 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c2c639ba3246..d4029d73f8af 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index a56e1f36389b..789f583e1d77 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 773b53b2cb76..abf3ccffc485 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 83dc1148cfa3..532f1457939a 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index bccd3f9fb178..20bd6d103b3d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 566d71a35ef0..906ddb06fb17 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 80cecab242f2..fe13d302ccbf 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index f0c02de95f7a..4b6037f378ee 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 710e62a9b587..c3deb2f28932 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 450a53b918ca..b61db7d6e716 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 6deb69fcd731..8ab4db44b73a 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 0c9ee2b7b9f4..4d1dafcc2c1f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index ab0eac0b304e..40c30cc8609c 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 4a7d22710441..18c3a024f122 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9e6b8d74e874..c3b778cbbed4 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index a973071d6c96..b9ce0e933256 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b2a6b7e2b8a6..0acd21fd1000 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 7e089dcee2b4..c223f993a69e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e890ef952520..6e8650f76d8e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index f65ae0623d6e..3f1237fee477 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a91b6061bcf7..4dd8a9a9f5a0 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 2d377c3edb02..a9e088808ed3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index e5eb92da696e..dff4083ae432 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f70328ca9e59..79f271ed7356 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? 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 fb57e03ff8dd..ad5f58eea436 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId:String = UUID().uuidString + let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil } } -fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -fileprivate class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { - +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ fileprivate class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -fileprivate class FileUploadEncoding: ParameterEncoding { +private class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ fileprivate class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ fileprivate class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Package.swift b/samples/client/petstore/swift5/urlsessionLibrary/Package.swift index 79f6f8188738..96dfff54edf4 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Package.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 6ee6f8f43c60..e4cbda9c725d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index bb3ae7178254..5bbf323f820c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class AnotherFakeAPI { /** To test special tags @@ -17,7 +15,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): 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 d1d81faa335c..134d6aea416a 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 @@ -7,8 +7,6 @@ import Foundation - - open class FakeAPI { /** @@ -16,7 +14,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -51,7 +49,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -86,7 +84,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -121,7 +119,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -156,7 +154,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -192,7 +190,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -231,7 +229,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -281,7 +279,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(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).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -318,7 +316,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(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) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -337,7 +335,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -426,7 +424,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -454,19 +452,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -492,7 +490,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -518,13 +516,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -545,7 +543,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -562,7 +560,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -582,7 +580,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -603,14 +601,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index d21c4a49d43d..48cfe7187b9a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,8 +7,6 @@ import Foundation - - open class FakeClassnameTags123API { /** To test class name in snake case @@ -17,7 +15,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 496da91171ac..0552d4a6c16e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class PetAPI { /** Add a new pet to the store @@ -17,7 +15,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -57,7 +55,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -84,8 +82,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -113,7 +111,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -137,8 +135,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -156,7 +154,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +178,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +197,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +224,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +240,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +281,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +309,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +333,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +361,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -387,7 +385,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -415,14 +413,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 3848eda85ad6..a8a83eda39a4 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class StoreAPI { /** Delete purchase order by ID @@ -17,7 +15,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -41,8 +39,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -56,7 +54,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -76,14 +74,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -95,7 +93,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,8 +117,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -135,7 +133,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 546166841d9e..505ed1b0c5c9 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class UserAPI { /** Create user @@ -17,7 +15,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -54,7 +52,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -90,7 +88,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -126,7 +124,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -150,8 +148,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -166,7 +164,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -189,8 +187,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -206,7 +204,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -228,11 +226,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -247,7 +245,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -266,8 +264,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -283,7 +281,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 4dc1d70aeb52..32e194f6ee12 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift index f171525e4394..627d9adb757e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 6e279679c67a..93ed6b90b376 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,5 +177,3 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } - - diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index 08f1ef334dff..b79e9f5e64d5 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? = nil + var returnedParams: [String: Any]? if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 314f1eff1f9b..02f78ffb4705 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? = nil + var params: [String: Any]? if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 9bf69037bf03..4dd8815847c6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } -public enum DownloadException : Error { +public enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -30,7 +30,6 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } - open class Response { public let statusCode: Int public let header: [String: String] @@ -44,7 +43,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 28ca8377b889..1af031535967 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 1050d79dbe9d..5ed9f31e2a36 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8ed2..e09b0e9efdc8 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 4d0393b9ba45..ec270da89074 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 1363c96394ba..6c252ed475b2 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 6b8873730c43..e84eb5d65025 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 64f7c6d9db99..d2140933d181 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index ddb669a59045..d1b3b27616ed 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index c4f6e0d488ca..7ab887f3113f 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 7b1d7e32be80..a51ad0dffab1 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { public var declawed: Bool? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 3ec00f5ab10d..eb8f7e5e1974 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index af030c3dd626..e2a7d4427a06 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { public var _class: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 0aae748c76b4..00245ca37280 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { public var client: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 198e28b94dd6..492c1228008e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 8ff49b2af23f..7786f8acc5ae 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { public var breed: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index e2d3fa04f94b..9844e7c40e35 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c2c639ba3246..d4029d73f8af 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index a56e1f36389b..789f583e1d77 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 773b53b2cb76..abf3ccffc485 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 83dc1148cfa3..532f1457939a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index bccd3f9fb178..20bd6d103b3d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { public var integer: Int? public var int32: Int? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 566d71a35ef0..906ddb06fb17 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 80cecab242f2..fe13d302ccbf 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index f0c02de95f7a..4b6037f378ee 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 710e62a9b587..c3deb2f28932 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 450a53b918ca..b61db7d6e716 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 6deb69fcd731..8ab4db44b73a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 0c9ee2b7b9f4..4d1dafcc2c1f 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index ab0eac0b304e..40c30cc8609c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { public enum Status: String, Codable, CaseIterable { case placed = "placed" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 4a7d22710441..18c3a024f122 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9e6b8d74e874..c3b778cbbed4 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index a973071d6c96..b9ce0e933256 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index b2a6b7e2b8a6..0acd21fd1000 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 7e089dcee2b4..c223f993a69e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index e890ef952520..6e8650f76d8e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index f65ae0623d6e..3f1237fee477 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index a91b6061bcf7..4dd8a9a9f5a0 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 2d377c3edb02..a9e088808ed3 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index e5eb92da696e..dff4083ae432 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f70328ca9e59..79f271ed7356 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? 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 fb57e03ff8dd..ad5f58eea436 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId:String = UUID().uuidString + let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil } } -fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -fileprivate class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { - +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ fileprivate class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -fileprivate class FileUploadEncoding: ParameterEncoding { +private class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ fileprivate class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ fileprivate class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/test/swift4/default/Package.swift b/samples/client/test/swift4/default/Package.swift index 407794321158..a2afb320f9aa 100644 --- a/samples/client/test/swift4/default/Package.swift +++ b/samples/client/test/swift4/default/Package.swift @@ -9,11 +9,11 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "TestClient", - targets: ["TestClient"]), + targets: ["TestClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -22,6 +22,6 @@ let package = Package( name: "TestClient", dependencies: ["Alamofire"], path: "TestClient/Classes" - ), + ) ] ) diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift index c8b83db00d5f..b8c1ec2d40df 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift @@ -9,23 +9,23 @@ import Foundation open class TestClientAPI { public static var basePath = "http://api.example.com/basePath" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -35,7 +35,7 @@ open class RequestBuilder { addHeaders(TestClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -58,5 +58,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift index 84ce8abdbf0e..22b7b0f9d96e 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class Swift4TestAPI { /** Get all of the models @@ -16,7 +14,7 @@ open class Swift4TestAPI { - parameter clientId: (query) id that represent the Api client - parameter completion: completion handler to receive the data and the error objects */ - open class func getAllModels(clientId: String, completion: @escaping ((_ data: GetAllModelsResult?,_ error: Error?) -> Void)) { + open class func getAllModels(clientId: String, completion: @escaping ((_ data: GetAllModelsResult?, _ error: Error?) -> Void)) { getAllModelsWithRequestBuilder(clientId: clientId).execute { (response, error) -> Void in completion(response?.body, error) } @@ -32,8 +30,8 @@ open class Swift4TestAPI { open class func getAllModelsWithRequestBuilder(clientId: String) -> RequestBuilder { let path = "/allModels" let URLString = TestClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "client_id": clientId.encodeToJSON() diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift index 56b66b0f1402..1487a4730f70 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -12,7 +12,7 @@ class AlamofireRequestBuilderFactory: RequestBuilderFactory { return AlamofireRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return AlamofireDecodableRequestBuilder.self } } @@ -50,7 +50,7 @@ private struct SynchronizedDictionary { private var managerStore = SynchronizedDictionary() open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } @@ -88,17 +88,17 @@ open class AlamofireRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the request configuration (e.g. to override the cache policy). */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId:String = UUID().uuidString + let managerId: String = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createSessionManager() managerStore[managerId] = manager - let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() let xMethod = Alamofire.HTTPMethod(rawValue: method) let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } @@ -111,8 +111,7 @@ open class AlamofireRequestBuilder: RequestBuilder { case let fileURL as URL: if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { + } else { mpForm.append(fileURL, withName: k) } case let string as String: @@ -276,7 +275,7 @@ open class AlamofireRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -284,7 +283,7 @@ open class AlamofireRequestBuilder: RequestBuilder { let items = contentDisposition.components(separatedBy: ";") - var filename : String? = nil + var filename: String? for contentItem in items { @@ -295,7 +294,7 @@ open class AlamofireRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -304,7 +303,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -318,7 +317,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -329,7 +328,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } -fileprivate enum DownloadException : Error { +private enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -344,7 +343,7 @@ public enum AlamofireDecodableRequestBuilderError: Error { case generalError(Error) } -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { if let credential = self.credential { @@ -436,7 +435,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilde return } - var responseObj: Response? = nil + var responseObj: Response? let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) if decodeResult.error == nil { diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift index 57bab28b1998..27cf29c65600 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift @@ -47,9 +47,9 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { - var returnedDecodable: T? = nil - var returnedError: Error? = nil + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { + var returnedDecodable: T? + var returnedError: Error? do { returnedDecodable = try self.jsonDecoder.decode(type, from: data) @@ -60,9 +60,9 @@ open class CodableHelper { return (returnedDecodable, returnedError) } - open class func encode(_ value: T) -> EncodeResult where T : Encodable { + open class func encode(_ value: T) -> EncodeResult where T: Encodable { var returnedData: Data? - var returnedError: Error? = nil + var returnedError: Error? do { returnedData = try self.jsonEncoder.encode(value) @@ -72,4 +72,4 @@ open class CodableHelper { return (returnedData, returnedError) } -} \ No newline at end of file +} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift index 516590da5d9e..e1ecb39726e7 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift @@ -7,9 +7,9 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift index 1f948ae12f78..74fcfcf2ad49 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -171,5 +171,3 @@ extension KeyedDecodingContainerProtocol { } } - - diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodableEncoding.swift index ca05906d4206..fb76bbed26f7 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodableEncoding.swift @@ -42,7 +42,7 @@ public struct JSONDataEncoding: ParameterEncoding { } public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? = nil + var returnedParams: Parameters? if let jsonData = jsonData, !jsonData.isEmpty { var params = Parameters() params[jsonDataKey] = jsonData diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 6ae673e1f8ca..827bdec87782 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -10,8 +10,8 @@ import Alamofire open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? // Encode the Encodable object if let encodableObj = encodableObj { @@ -25,7 +25,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? = nil + var params: Parameters? if let encodableObj = encodableObj { do { @@ -39,5 +39,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift index 408563890359..25161165865e 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift @@ -10,7 +10,7 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } @@ -27,7 +27,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift index 88cfe74154f0..64073972bc6e 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift @@ -8,8 +8,7 @@ import Foundation /** Object which contains lots of different primitive OpenAPI types */ -public struct AllPrimitives: Codable { - +public struct AllPrimitives: Codable { public enum MyInlineStringEnum: String, Codable { case inlinestringenumvalue1 = "inlineStringEnumValue1" diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift index 4e82fadd2eee..2ffb3a5e1ab9 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift @@ -8,8 +8,7 @@ import Foundation /** This is a base card object which uses a 'cardType' discriminator. */ -public struct BaseCard: Codable { - +public struct BaseCard: Codable { public var cardType: String diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift index 8b512aa78baf..c2b1fcda5868 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift @@ -8,8 +8,7 @@ import Foundation /** Example Error object */ -public struct ErrorInfo: Codable { - +public struct ErrorInfo: Codable { public var code: Int? public var message: String? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift index 9cdaac272756..b8cfedbe94af 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift @@ -8,8 +8,7 @@ import Foundation /** Response object containing AllPrimitives object */ -public struct GetAllModelsResult: Codable { - +public struct GetAllModelsResult: Codable { public var myPrimitiveArray: [AllPrimitives]? public var myPrimitive: AllPrimitives? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift index 600a23f206ca..2878543406a4 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift @@ -8,11 +8,9 @@ import Foundation /** This is an empty model with no properties and only additionalProperties of type int32 */ -public struct ModelWithIntAdditionalPropertiesOnly: Codable { +public struct ModelWithIntAdditionalPropertiesOnly: Codable { - - - public var additionalProperties: [String:Int] = [:] + public var additionalProperties: [String: Int] = [:] public subscript(key: String) -> Int? { get { @@ -45,5 +43,4 @@ public struct ModelWithIntAdditionalPropertiesOnly: Codable { additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift index 606429c8bd21..d8f115cb4998 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift @@ -8,8 +8,7 @@ import Foundation /** This is an empty model with no properties and only additionalProperties of type int32 */ -public struct ModelWithPropertiesAndAdditionalProperties: Codable { - +public struct ModelWithPropertiesAndAdditionalProperties: Codable { public var myIntegerReq: Int public var myIntegerOpt: Int? @@ -30,7 +29,7 @@ public struct ModelWithPropertiesAndAdditionalProperties: Codable { self.myPrimitiveArrayReq = myPrimitiveArrayReq self.myPrimitiveArrayOpt = myPrimitiveArrayOpt } - public var additionalProperties: [String:String] = [:] + public var additionalProperties: [String: String] = [:] public subscript(key: String) -> String? { get { @@ -87,5 +86,4 @@ public struct ModelWithPropertiesAndAdditionalProperties: Codable { additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift index a23c9c9aa0b6..fffed8885315 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift @@ -8,11 +8,9 @@ import Foundation /** This is an empty model with no properties and only additionalProperties of type string */ -public struct ModelWithStringAdditionalPropertiesOnly: Codable { +public struct ModelWithStringAdditionalPropertiesOnly: Codable { - - - public var additionalProperties: [String:String] = [:] + public var additionalProperties: [String: String] = [:] public subscript(key: String) -> String? { get { @@ -45,5 +43,4 @@ public struct ModelWithStringAdditionalPropertiesOnly: Codable { additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift index 6c50ccc4ca16..db1a081b275d 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift @@ -8,8 +8,7 @@ import Foundation /** This is a card object for a Person derived from BaseCard. */ -public struct PersonCard: Codable { - +public struct PersonCard: Codable { public var cardType: String public var firstName: String? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift index 8ff2db3bd880..e11d38985a2e 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct PersonCardAllOf: Codable { - +public struct PersonCardAllOf: Codable { public var firstName: String? public var lastName: String? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift index 63abaeda4bd8..0fd94cf83640 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift @@ -8,8 +8,7 @@ import Foundation /** This is a card object for a Person derived from BaseCard. */ -public struct PlaceCard: Codable { - +public struct PlaceCard: Codable { public var cardType: String public var placeName: String? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift index 9f1da50fd576..c5e89a15e00f 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct PlaceCardAllOf: Codable { - +public struct PlaceCardAllOf: Codable { public var placeName: String? public var placeAddress: String? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift index 9ef4613093d8..7d884d88e185 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift @@ -8,8 +8,7 @@ import Foundation /** This is a base class object from which other classes will derive. */ -public struct SampleBase: Codable { - +public struct SampleBase: Codable { public var baseClassStringProp: String? public var baseClassIntegerProp: Int? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift index 1f8fe4e60982..c6ffc74a959d 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift @@ -8,8 +8,7 @@ import Foundation /** This is a subclass defived from the SampleBase class. */ -public struct SampleSubClass: Codable { - +public struct SampleSubClass: Codable { public var baseClassStringProp: String? public var baseClassIntegerProp: Int? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift index 08ad426146a5..7f52bb9fef4c 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SampleSubClassAllOf: Codable { - +public struct SampleSubClassAllOf: Codable { public var subClassStringProp: String? public var subClassIntegerProp: Int? diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift index d4cce19e6d6d..67c1c22deda7 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum StringEnum: String, Codable { case stringenumvalue1 = "stringEnumValue1" case stringenumvalue2 = "stringEnumValue2" diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift index 8b5a61cb132c..285d86a56941 100644 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift +++ b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift @@ -8,8 +8,7 @@ import Foundation /** This object contains property names which we know will be different from their variable name. Examples of this include snake case property names and property names which are Swift 4 reserved words. */ -public struct VariableNameTest: Codable { - +public struct VariableNameTest: Codable { /** This snake-case examle_name property name should be converted to a camelCase variable name like exampleName */ public var exampleName: String? @@ -24,7 +23,7 @@ public struct VariableNameTest: Codable { self.normalName = normalName } - public enum CodingKeys: String, CodingKey { + public enum CodingKeys: String, CodingKey { case exampleName = "example_name" case _for = "for" case normalName diff --git a/samples/client/test/swift4/default/docs/SampleSubClass.md b/samples/client/test/swift4/default/docs/SampleSubClass.md index d32058a5b2c4..435633ccde1c 100644 --- a/samples/client/test/swift4/default/docs/SampleSubClass.md +++ b/samples/client/test/swift4/default/docs/SampleSubClass.md @@ -3,6 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**baseClassStringProp** | **String** | | [optional] +**baseClassIntegerProp** | **Int** | | [optional] **subClassStringProp** | **String** | | [optional] **subClassIntegerProp** | **Int** | | [optional] diff --git a/samples/client/test/swift5/default/Package.swift b/samples/client/test/swift5/default/Package.swift index 1db5df4fd683..25d70eebdedc 100644 --- a/samples/client/test/swift5/default/Package.swift +++ b/samples/client/test/swift5/default/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "TestClient", - targets: ["TestClient"]), + targets: ["TestClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "TestClient", dependencies: [], path: "TestClient/Classes" - ), + ) ] ) diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIHelper.swift index d94614b34fc7..200070096800 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { let destination = source.reduce(into: [String: Any]()) { (result, item) in if let value = item.value { result[item.key] = value @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? Array { - result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? Array { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs.swift index 0ab78fdb762c..359d938d4534 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class TestClientAPI { public static var basePath = "http://api.example.com/basePath" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(TestClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs/Swift5TestAPI.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs/Swift5TestAPI.swift index 1995eb9567c9..6987b61a1a4d 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs/Swift5TestAPI.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs/Swift5TestAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class Swift5TestAPI { /** Get all of the models @@ -17,7 +15,7 @@ open class Swift5TestAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getAllModels(clientId: String, apiResponseQueue: DispatchQueue = TestClientAPI.apiResponseQueue, completion: @escaping ((_ data: GetAllModelsResult?,_ error: Error?) -> Void)) { + open class func getAllModels(clientId: String, apiResponseQueue: DispatchQueue = TestClientAPI.apiResponseQueue, completion: @escaping ((_ data: GetAllModelsResult?, _ error: Error?) -> Void)) { getAllModelsWithRequestBuilder(clientId: clientId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -38,8 +36,8 @@ open class Swift5TestAPI { open class func getAllModelsWithRequestBuilder(clientId: String) -> RequestBuilder { let path = "/allModels" let URLString = TestClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "client_id": clientId.encodeToJSON() diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/CodableHelper.swift index 4dc1d70aeb52..32e194f6ee12 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Result where T: Encodable { return Result { try self.jsonEncoder.encode(value) } } -} \ No newline at end of file +} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Configuration.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Configuration.swift index f171525e4394..627d9adb757e 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open class Configuration { - + // This value is used to configure the date formatter that is used to serialize dates into JSON format. // You must set it prior to encoding any dates, and it will only be read once. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Extensions.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Extensions.swift index 6e279679c67a..93ed6b90b376 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] for key in allKeys { if !excludedKeys.contains(key) { @@ -177,5 +177,3 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } - - diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONDataEncoding.swift index 08f1ef334dff..b79e9f5e64d5 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? = nil + var returnedParams: [String: Any]? if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 314f1eff1f9b..02f78ffb4705 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? = nil + var params: [String: Any]? if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models.swift index 9bf69037bf03..4dd8815847c6 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } -public enum DownloadException : Error { +public enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -30,7 +30,6 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } - open class Response { public let statusCode: Int public let header: [String: String] @@ -44,7 +43,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for case let (key, value) as (String, String) in rawHeader { header[key] = value } diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift index 68b5bd75ab35..dc6571db3e95 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift @@ -8,8 +8,7 @@ import Foundation /** Object which contains lots of different primitive OpenAPI types */ -public struct AllPrimitives: Codable { - +public struct AllPrimitives: Codable { public enum MyInlineStringEnum: String, Codable, CaseIterable { case inlinestringenumvalue1 = "inlineStringEnumValue1" diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift index 4e82fadd2eee..2ffb3a5e1ab9 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift @@ -8,8 +8,7 @@ import Foundation /** This is a base card object which uses a 'cardType' discriminator. */ -public struct BaseCard: Codable { - +public struct BaseCard: Codable { public var cardType: String diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift index 8b512aa78baf..c2b1fcda5868 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift @@ -8,8 +8,7 @@ import Foundation /** Example Error object */ -public struct ErrorInfo: Codable { - +public struct ErrorInfo: Codable { public var code: Int? public var message: String? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift index 9cdaac272756..b8cfedbe94af 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift @@ -8,8 +8,7 @@ import Foundation /** Response object containing AllPrimitives object */ -public struct GetAllModelsResult: Codable { - +public struct GetAllModelsResult: Codable { public var myPrimitiveArray: [AllPrimitives]? public var myPrimitive: AllPrimitives? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift index 600a23f206ca..2878543406a4 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift @@ -8,11 +8,9 @@ import Foundation /** This is an empty model with no properties and only additionalProperties of type int32 */ -public struct ModelWithIntAdditionalPropertiesOnly: Codable { +public struct ModelWithIntAdditionalPropertiesOnly: Codable { - - - public var additionalProperties: [String:Int] = [:] + public var additionalProperties: [String: Int] = [:] public subscript(key: String) -> Int? { get { @@ -45,5 +43,4 @@ public struct ModelWithIntAdditionalPropertiesOnly: Codable { additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift index 606429c8bd21..d8f115cb4998 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift @@ -8,8 +8,7 @@ import Foundation /** This is an empty model with no properties and only additionalProperties of type int32 */ -public struct ModelWithPropertiesAndAdditionalProperties: Codable { - +public struct ModelWithPropertiesAndAdditionalProperties: Codable { public var myIntegerReq: Int public var myIntegerOpt: Int? @@ -30,7 +29,7 @@ public struct ModelWithPropertiesAndAdditionalProperties: Codable { self.myPrimitiveArrayReq = myPrimitiveArrayReq self.myPrimitiveArrayOpt = myPrimitiveArrayOpt } - public var additionalProperties: [String:String] = [:] + public var additionalProperties: [String: String] = [:] public subscript(key: String) -> String? { get { @@ -87,5 +86,4 @@ public struct ModelWithPropertiesAndAdditionalProperties: Codable { additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift index a23c9c9aa0b6..fffed8885315 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift @@ -8,11 +8,9 @@ import Foundation /** This is an empty model with no properties and only additionalProperties of type string */ -public struct ModelWithStringAdditionalPropertiesOnly: Codable { +public struct ModelWithStringAdditionalPropertiesOnly: Codable { - - - public var additionalProperties: [String:String] = [:] + public var additionalProperties: [String: String] = [:] public subscript(key: String) -> String? { get { @@ -45,5 +43,4 @@ public struct ModelWithStringAdditionalPropertiesOnly: Codable { additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } - } diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift index 6c50ccc4ca16..db1a081b275d 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift @@ -8,8 +8,7 @@ import Foundation /** This is a card object for a Person derived from BaseCard. */ -public struct PersonCard: Codable { - +public struct PersonCard: Codable { public var cardType: String public var firstName: String? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift index 8ff2db3bd880..e11d38985a2e 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct PersonCardAllOf: Codable { - +public struct PersonCardAllOf: Codable { public var firstName: String? public var lastName: String? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift index 63abaeda4bd8..0fd94cf83640 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift @@ -8,8 +8,7 @@ import Foundation /** This is a card object for a Person derived from BaseCard. */ -public struct PlaceCard: Codable { - +public struct PlaceCard: Codable { public var cardType: String public var placeName: String? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift index 9f1da50fd576..c5e89a15e00f 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct PlaceCardAllOf: Codable { - +public struct PlaceCardAllOf: Codable { public var placeName: String? public var placeAddress: String? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift index 9ef4613093d8..7d884d88e185 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift @@ -8,8 +8,7 @@ import Foundation /** This is a base class object from which other classes will derive. */ -public struct SampleBase: Codable { - +public struct SampleBase: Codable { public var baseClassStringProp: String? public var baseClassIntegerProp: Int? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift index 1f8fe4e60982..c6ffc74a959d 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift @@ -8,8 +8,7 @@ import Foundation /** This is a subclass defived from the SampleBase class. */ -public struct SampleSubClass: Codable { - +public struct SampleSubClass: Codable { public var baseClassStringProp: String? public var baseClassIntegerProp: Int? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift index 08ad426146a5..7f52bb9fef4c 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift @@ -7,9 +7,7 @@ import Foundation - -public struct SampleSubClassAllOf: Codable { - +public struct SampleSubClassAllOf: Codable { public var subClassStringProp: String? public var subClassIntegerProp: Int? diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift index b8b82ebeb310..48273ea2c2ce 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum StringEnum: String, Codable, CaseIterable { case stringenumvalue1 = "stringEnumValue1" case stringenumvalue2 = "stringEnumValue2" diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift index c445af38c130..9b67f8a4af24 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift @@ -8,8 +8,7 @@ import Foundation /** This object contains property names which we know will be different from their variable name. Examples of this include snake case property names and property names which are Swift 5 reserved words. */ -public struct VariableNameTest: Codable { - +public struct VariableNameTest: Codable { /** This snake-case examle_name property name should be converted to a camelCase variable name like exampleName */ public var exampleName: String? @@ -24,7 +23,7 @@ public struct VariableNameTest: Codable { self.normalName = normalName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case exampleName = "example_name" case _for = "for" case normalName diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift index 7d6c57044d81..7cf1df17fb79 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) } - + /** May be overridden by a subclass if you want to control the URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = TestClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { - let urlSessionId:String = UUID().uuidString + let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let requestURL = try self.getURL(from: urlRequest) - + var requestPath = try self.getPath(from: requestURL) - + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { requestPath = requestPath.appending("/\(headerFileName)") } - + let filePath = documentsDirectory.appendingPathComponent(requestPath) let directoryPath = filePath.deletingLastPathComponent().path - + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) try data.write(to: filePath, options: .atomic) - + completion(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil } } -fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -fileprivate class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { - +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ fileprivate class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -fileprivate class FileUploadEncoding: ParameterEncoding { +private class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ fileprivate class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ fileprivate class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/test/swift5/default/docs/SampleSubClass.md b/samples/client/test/swift5/default/docs/SampleSubClass.md index d32058a5b2c4..435633ccde1c 100644 --- a/samples/client/test/swift5/default/docs/SampleSubClass.md +++ b/samples/client/test/swift5/default/docs/SampleSubClass.md @@ -3,6 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**baseClassStringProp** | **String** | | [optional] +**baseClassIntegerProp** | **Int** | | [optional] **subClassStringProp** | **String** | | [optional] **subClassIntegerProp** | **Int** | | [optional] diff --git a/samples/config/petstore/apache2/.openapi-generator/VERSION b/samples/config/petstore/apache2/.openapi-generator/VERSION index bfbf77eb7fad..7fea99011a6f 100644 --- a/samples/config/petstore/apache2/.openapi-generator/VERSION +++ b/samples/config/petstore/apache2/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +2.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/apache2/PetApi.conf b/samples/config/petstore/apache2/PetApi.conf index 2d28dcdaa61b..c92843e2610f 100644 --- a/samples/config/petstore/apache2/PetApi.conf +++ b/samples/config/petstore/apache2/PetApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -16,7 +16,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -34,7 +34,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -48,7 +48,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -62,7 +62,7 @@ Require group read:pets - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/apache2/StoreApi.conf b/samples/config/petstore/apache2/StoreApi.conf index b223a8816ba6..f0fb742f55ac 100644 --- a/samples/config/petstore/apache2/StoreApi.conf +++ b/samples/config/petstore/apache2/StoreApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -14,7 +14,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -24,7 +24,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/apache2/UserApi.conf b/samples/config/petstore/apache2/UserApi.conf index 699b2b72c16c..b01bb509728a 100644 --- a/samples/config/petstore/apache2/UserApi.conf +++ b/samples/config/petstore/apache2/UserApi.conf @@ -1,4 +1,4 @@ - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -11,7 +11,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -24,7 +24,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -37,7 +37,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -56,7 +56,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" @@ -69,7 +69,7 @@ Require valid-user - + AuthBasicProvider file AuthUserFile "/var/www/html/htpwd" AuthGroupFile "/var/www/html/groups" diff --git a/samples/config/petstore/graphql-schema/.openapi-generator/VERSION b/samples/config/petstore/graphql-schema/.openapi-generator/VERSION index bfbf77eb7fad..afa636560641 100644 --- a/samples/config/petstore/graphql-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/graphql-schema/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql b/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql index 865b0eb73190..07bdf0c0adb4 100644 --- a/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql +++ b/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# The version of the OpenAPI document: 1.0.0 +# OpenAPI spec version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql b/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql index 8c4137a4a4a4..30e2a034f20a 100644 --- a/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql +++ b/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# The version of the OpenAPI document: 1.0.0 +# OpenAPI spec version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql b/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql index e873f153b58d..12335c2207e5 100644 --- a/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql +++ b/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# The version of the OpenAPI document: 1.0.0 +# OpenAPI spec version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql b/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql index 9db63eae5b9d..2f8221d6f776 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# The version of the OpenAPI document: 1.0.0 +# OpenAPI spec version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/category.graphql b/samples/config/petstore/graphql-schema/petstore/model/category.graphql index b75961d86df7..eeeef5998ae4 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/category.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/category.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# The version of the OpenAPI document: 1.0.0 +# OpenAPI spec version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/order.graphql b/samples/config/petstore/graphql-schema/petstore/model/order.graphql index af6f699f8a95..a76301107ac2 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/order.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/order.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# The version of the OpenAPI document: 1.0.0 +# OpenAPI spec version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/pet.graphql b/samples/config/petstore/graphql-schema/petstore/model/pet.graphql index c346af193587..e8ce58e93da3 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/pet.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/pet.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# The version of the OpenAPI document: 1.0.0 +# OpenAPI spec version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/tag.graphql b/samples/config/petstore/graphql-schema/petstore/model/tag.graphql index a5002f44c9c1..9fc620141a8c 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/tag.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/tag.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# The version of the OpenAPI document: 1.0.0 +# OpenAPI spec version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/graphql-schema/petstore/model/user.graphql b/samples/config/petstore/graphql-schema/petstore/model/user.graphql index 2f678c28ea7b..da66c49fb83e 100644 --- a/samples/config/petstore/graphql-schema/petstore/model/user.graphql +++ b/samples/config/petstore/graphql-schema/petstore/model/user.graphql @@ -1,6 +1,6 @@ # OpenAPI Petstore # This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# The version of the OpenAPI document: 1.0.0 +# OpenAPI spec version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION index bfbf77eb7fad..c3a2c7076fa8 100644 --- a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/asciidoc/.openapi-generator/VERSION b/samples/documentation/asciidoc/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/documentation/asciidoc/.openapi-generator/VERSION +++ b/samples/documentation/asciidoc/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/cwiki/.openapi-generator/VERSION b/samples/documentation/cwiki/.openapi-generator/VERSION index bfbf77eb7fad..d077ffb477a4 100644 --- a/samples/documentation/cwiki/.openapi-generator/VERSION +++ b/samples/documentation/cwiki/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.4-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/cwiki/confluence-markup.txt b/samples/documentation/cwiki/confluence-markup.txt index 4e13d4757fb8..f790908e8f14 100644 --- a/samples/documentation/cwiki/confluence-markup.txt +++ b/samples/documentation/cwiki/confluence-markup.txt @@ -1,121 +1,128 @@ -h1. OpenAPI Petstore - -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +h1. OpenAPI Petstore This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. *Version:* 1.0.0 ---- -{expand:Table of Contents - Click to expand} {toc:printable=true|style=square|minLevel=2|maxLevel=3|type=list|outline=false|include=.*} -{expand} h2. Endpoints - -h3. addPet -{panel:title=addPet|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + h3. addPet + {status:colour=Yellow|title=post|subtle=false} + {code} + post /pet + {code} *Summary:* Add a new pet to the store - *Description:* *No Description* + *Description:* - || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/pet{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - ----- -h4. Parameters -h5. Body Parameter + h4. Parameters + + h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |body |Pet object that needs to be added to the store |(/) | | | + |pet |Pet object that needs to be added to the store |(/) | | | + ----- -h4. Responses - || Status Code | {status:colour=Green|title=405|subtle=false} | - || Message | Invalid input | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "Invalid input", - "content" : { } -}{code} | - -{panel} + h4. Responses + *Status Code:* 405 + *Message:* Invalid input + {code:title=Response Type} + {code} + See [#models] -h3. deletePet -{panel:title=deletePet|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + + + {code:title=Response Schema |collapse=true} +{ + "description" : "Invalid input", + "content" : { } +} + {code} + ---- + + h3. deletePet + {status:colour=Yellow|title=delete|subtle=false} + {code} + delete /pet/{petId} + {code} *Summary:* Deletes a pet - *Description:* *No Description* + *Description:* - || HttpMethod | {status:colour=Yellow|title=delete|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/pet/{petId}{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - ----- -h4. Parameters -h5. Path Parameters + + h4. Parameters + h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |petId |Pet id to delete |(/) |null | | -h5. Header Parameters + h5. Header Parameters ||Name||Description||Required||Default||Pattern|| |apiKey | |(x) |null | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=400|subtle=false} | - || Message | Invalid pet value | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "Invalid pet value", - "content" : { } -}{code} | - -{panel} + + + h4. Responses + *Status Code:* 400 + *Message:* Invalid pet value + {code:title=Response Type} + + {code} + See [#models] -h3. findPetsByStatus -{panel:title=findPetsByStatus|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + {code:title=Response Schema |collapse=true} +{ + "description" : "Invalid pet value", + "content" : { } +} + {code} + ---- + + h3. findPetsByStatus + {status:colour=Yellow|title=get|subtle=false} + {code} + get /pet/findByStatus + {code} *Summary:* Finds Pets by status *Description:* Multiple status values can be provided with comma separated strings - || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/pet/findByStatus{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | ----- -h4. Parameters + + h4. Parameters -h5. Query Parameters + h5. Query Parameters ||Name||Description||Required||Default||Pattern|| |status |Status values that need to be considered for filter |(/) |null | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=200|subtle=false} | - || Message | successful operation | - || Response Type | array[Pet] | - || Response Model | [array[Pet] Model|#array[Pet]ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + + + h4. Responses + *Status Code:* 200 + *Message:* successful operation + {code:title=Response Type} +array[Pet] + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ "description" : "successful operation", "content" : { "application/xml" : { @@ -135,51 +142,58 @@ h4. Responses } } } -}{code} | - +} + {code} + *Status Code:* 400 + *Message:* Invalid status value + {code:title=Response Type} - - || Status Code | {status:colour=Green|title=400|subtle=false} | - || Message | Invalid status value | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "Invalid status value", - "content" : { } -}{code} | - - -{panel} + {code} + See [#models] -h3. findPetsByTags -{panel:title=findPetsByTags|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + {code:title=Response Schema |collapse=true} +{ + "description" : "Invalid status value", + "content" : { } +} + {code} + ---- + + h3. findPetsByTags + {status:colour=Yellow|title=get|subtle=false} + {code} + get /pet/findByTags + {code} *Summary:* Finds Pets by tags *Description:* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/pet/findByTags{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | ----- -h4. Parameters + + h4. Parameters -h5. Query Parameters + h5. Query Parameters ||Name||Description||Required||Default||Pattern|| |tags |Tags to filter by |(/) |null | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=200|subtle=false} | - || Message | successful operation | - || Response Type | array[Pet] | - || Response Model | [array[Pet] Model|#array[Pet]ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + + + h4. Responses + *Status Code:* 200 + *Message:* successful operation + {code:title=Response Type} +array[Pet] + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ "description" : "successful operation", "content" : { "application/xml" : { @@ -199,51 +213,58 @@ h4. Responses } } } -}{code} | - +} + {code} + *Status Code:* 400 + *Message:* Invalid tag value + {code:title=Response Type} + {code} + See [#models] - || Status Code | {status:colour=Green|title=400|subtle=false} | - || Message | Invalid tag value | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "Invalid tag value", - "content" : { } -}{code} | - - -{panel} - -h3. getPetById -{panel:title=getPetById|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + {code:title=Response Schema |collapse=true} +{ + "description" : "Invalid tag value", + "content" : { } +} + {code} + ---- + + h3. getPetById + {status:colour=Yellow|title=get|subtle=false} + {code} + get /pet/{petId} + {code} *Summary:* Find pet by ID *Description:* Returns a single pet - || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/pet/{petId}{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | ----- -h4. Parameters -h5. Path Parameters + + h4. Parameters + h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |petId |ID of pet to return |(/) |null | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=200|subtle=false} | - || Message | successful operation | - || Response Type | Pet | - || Response Model | [Pet Model|#PetModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + + + h4. Responses + *Status Code:* 200 + *Message:* successful operation + {code:title=Response Type} +Pet + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ "description" : "successful operation", "content" : { "application/xml" : { @@ -257,156 +278,181 @@ h4. Responses } } } -}{code} | - +} + {code} + *Status Code:* 400 + *Message:* Invalid ID supplied + {code:title=Response Type} + + {code} + See [#models] - || Status Code | {status:colour=Green|title=400|subtle=false} | - || Message | Invalid ID supplied | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + {code:title=Response Schema |collapse=true} +{ "description" : "Invalid ID supplied", "content" : { } -}{code} | - +} + {code} + *Status Code:* 404 + *Message:* Pet not found + {code:title=Response Type} + + {code} + See [#models] - || Status Code | {status:colour=Green|title=404|subtle=false} | - || Message | Pet not found | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + {code:title=Response Schema |collapse=true} +{ "description" : "Pet not found", "content" : { } -}{code} | - +} + {code} + ---- + + h3. updatePet + {status:colour=Yellow|title=put|subtle=false} + {code} + put /pet + {code} + *Summary:* Update an existing pet + *Description:* -{panel} + h4. Parameters + h5. Body Parameter + ||Name||Description||Required||Default||Pattern|| + |pet |Pet object that needs to be added to the store |(/) | | | -h3. updatePet -{panel:title=updatePet|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} - *Summary:* Update an existing pet - *Description:* *No Description* - || HttpMethod | {status:colour=Yellow|title=put|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/pet{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - ----- -h4. Parameters -h5. Body Parameter - ||Name||Description||Required||Default||Pattern|| - |body |Pet object that needs to be added to the store |(/) | | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=400|subtle=false} | - || Message | Invalid ID supplied | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + h4. Responses + *Status Code:* 400 + *Message:* Invalid ID supplied + {code:title=Response Type} + + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ "description" : "Invalid ID supplied", "content" : { } -}{code} | - +} + {code} + *Status Code:* 404 + *Message:* Pet not found + {code:title=Response Type} + {code} + See [#models] - || Status Code | {status:colour=Green|title=404|subtle=false} | - || Message | Pet not found | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "Pet not found", - "content" : { } -}{code} | - - || Status Code | {status:colour=Green|title=405|subtle=false} | - || Message | Validation exception | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "Validation exception", + {code:title=Response Schema |collapse=true} +{ + "description" : "Pet not found", "content" : { } -}{code} | - +} + {code} + *Status Code:* 405 + *Message:* Validation exception + {code:title=Response Type} -{panel} + {code} + See [#models] -h3. updatePetWithForm -{panel:title=updatePetWithForm|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + {code:title=Response Schema |collapse=true} +{ + "description" : "Validation exception", + "content" : { } +} + {code} + ---- + + h3. updatePetWithForm + {status:colour=Yellow|title=post|subtle=false} + {code} + post /pet/{petId} + {code} *Summary:* Updates a pet in the store with form data - *Description:* *No Description* + *Description:* - || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/pet/{petId}{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - ----- -h4. Parameters -h5. Path Parameters + + h4. Parameters + h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |petId |ID of pet that needs to be updated |(/) |null | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=405|subtle=false} | - || Message | Invalid input | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "Invalid input", - "content" : { } -}{code} | - -{panel} + h4. Responses + *Status Code:* 405 + *Message:* Invalid input + {code:title=Response Type} -h3. uploadFile -{panel:title=uploadFile|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ + "description" : "Invalid input", + "content" : { } +} + {code} + ---- + + h3. uploadFile + {status:colour=Yellow|title=post|subtle=false} + {code} + post /pet/{petId}/uploadImage + {code} *Summary:* uploads an image - *Description:* *No Description* + *Description:* - || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/pet/{petId}/uploadImage{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - || Produces | {noformat:nopanel=true}application/json{noformat} | ----- -h4. Parameters -h5. Path Parameters + + h4. Parameters + h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |petId |ID of pet to update |(/) |null | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=200|subtle=false} | - || Message | successful operation | - || Response Type | ApiResponse | - || Response Model | [ApiResponse Model|#ApiResponseModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + + + h4. Responses + *Status Code:* 200 + *Message:* successful operation + {code:title=Response Type} +ApiResponse + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ "description" : "successful operation", "content" : { "application/json" : { @@ -415,83 +461,93 @@ h4. Responses } } } -}{code} | - - -{panel} - - - -h3. deleteOrder -{panel:title=deleteOrder|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} +} + {code} + ---- + + h3. deleteOrder + {status:colour=Yellow|title=delete|subtle=false} + {code} + delete /store/order/{orderId} + {code} *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 - || HttpMethod | {status:colour=Yellow|title=delete|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/store/order/{orderId}{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - ----- -h4. Parameters -h5. Path Parameters + + h4. Parameters + h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |orderId |ID of the order that needs to be deleted |(/) |null | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=400|subtle=false} | - || Message | Invalid ID supplied | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + + + h4. Responses + *Status Code:* 400 + *Message:* Invalid ID supplied + {code:title=Response Type} + + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ "description" : "Invalid ID supplied", "content" : { } -}{code} | - +} + {code} + *Status Code:* 404 + *Message:* Order not found + {code:title=Response Type} + + {code} + See [#models] - || Status Code | {status:colour=Green|title=404|subtle=false} | - || Message | Order not found | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + {code:title=Response Schema |collapse=true} +{ "description" : "Order not found", "content" : { } -}{code} | - +} + {code} + ---- + + h3. getInventory + {status:colour=Yellow|title=get|subtle=false} + {code} + get /store/inventory + {code} + *Summary:* Returns pet inventories by status + *Description:* Returns a map of status codes to quantities -{panel} + h4. Parameters -h3. getInventory -{panel:title=getInventory|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} - *Summary:* Returns pet inventories by status - *Description:* Returns a map of status codes to quantities - || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/store/inventory{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - || Produces | {noformat:nopanel=true}application/json{noformat} | ----- -h4. Parameters ----- -h4. Responses - || Status Code | {status:colour=Green|title=200|subtle=false} | - || Message | successful operation | - || Response Type | map[String, Integer] | - || Response Model | [map[String, Integer] Model|#map[String, Integer]ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + h4. Responses + *Status Code:* 200 + *Message:* successful operation + {code:title=Response Type} +map[String, Integer] + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ "description" : "successful operation", "content" : { "application/json" : { @@ -504,40 +560,43 @@ h4. Responses } } } -}{code} | - - -{panel} - - - -h3. getOrderById -{panel:title=getOrderById|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} +} + {code} + ---- + + h3. getOrderById + {status:colour=Yellow|title=get|subtle=false} + {code} + get /store/order/{orderId} + {code} *Summary:* Find purchase order by ID *Description:* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/store/order/{orderId}{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | ----- -h4. Parameters -h5. Path Parameters + + h4. Parameters + h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |orderId |ID of pet that needs to be fetched |(/) |null | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=200|subtle=false} | - || Message | successful operation | - || Response Type | Order | - || Response Model | [Order Model|#OrderModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + + + h4. Responses + *Status Code:* 200 + *Message:* successful operation + {code:title=Response Type} +Order + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ "description" : "successful operation", "content" : { "application/xml" : { @@ -551,62 +610,73 @@ h4. Responses } } } -}{code} | - +} + {code} + *Status Code:* 400 + *Message:* Invalid ID supplied + {code:title=Response Type} + + {code} + See [#models] + - || Status Code | {status:colour=Green|title=400|subtle=false} | - || Message | Invalid ID supplied | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + {code:title=Response Schema |collapse=true} +{ "description" : "Invalid ID supplied", "content" : { } -}{code} | - +} + {code} + *Status Code:* 404 + *Message:* Order not found + {code:title=Response Type} + {code} + See [#models] - || Status Code | {status:colour=Green|title=404|subtle=false} | - || Message | Order not found | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + + {code:title=Response Schema |collapse=true} +{ "description" : "Order not found", "content" : { } -}{code} | - +} + {code} + ---- + + h3. placeOrder + {status:colour=Yellow|title=post|subtle=false} + {code} + post /store/order + {code} + *Summary:* Place an order for a pet + *Description:* -{panel} + h4. Parameters + h5. Body Parameter + ||Name||Description||Required||Default||Pattern|| + |order |order placed for purchasing the pet |(/) | | | -h3. placeOrder -{panel:title=placeOrder|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} - *Summary:* Place an order for a pet - *Description:* *No Description* - || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/store/order{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | ----- -h4. Parameters -h5. Body Parameter - ||Name||Description||Required||Default||Pattern|| - |body |order placed for purchasing the pet |(/) | | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=200|subtle=false} | - || Message | successful operation | - || Response Type | Order | - || Response Model | [Order Model|#OrderModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + h4. Responses + *Status Code:* 200 + *Message:* successful operation + {code:title=Response Type} +Order + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ "description" : "successful operation", "content" : { "application/xml" : { @@ -620,206 +690,229 @@ h4. Responses } } } -}{code} | - +} + {code} + *Status Code:* 400 + *Message:* Invalid Order + {code:title=Response Type} + + {code} + See [#models] - || Status Code | {status:colour=Green|title=400|subtle=false} | - || Message | Invalid Order | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + {code:title=Response Schema |collapse=true} +{ "description" : "Invalid Order", "content" : { } -}{code} | - +} + {code} + ---- + + h3. createUser + {status:colour=Yellow|title=post|subtle=false} + {code} + post /user + {code} + *Summary:* Create user + *Description:* This can only be done by the logged in user. -{panel} + h4. Parameters + h5. Body Parameter + ||Name||Description||Required||Default||Pattern|| + |user |Created user object |(/) | | | -h3. createUser -{panel:title=createUser|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} - *Summary:* Create user - *Description:* This can only be done by the logged in user. - || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/user{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - ----- -h4. Parameters -h5. Body Parameter - ||Name||Description||Required||Default||Pattern|| - |body |Created user object |(/) | | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=0|subtle=false} | - || Message | successful operation | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "successful operation", - "content" : { } -}{code} | - + h4. Responses + *Status Code:* 0 + *Message:* successful operation + {code:title=Response Type} -{panel} + {code} + See [#models] -h3. createUsersWithArrayInput -{panel:title=createUsersWithArrayInput|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + {code:title=Response Schema |collapse=true} +{ + "description" : "successful operation", + "content" : { } +} + {code} + ---- + + h3. createUsersWithArrayInput + {status:colour=Yellow|title=post|subtle=false} + {code} + post /user/createWithArray + {code} *Summary:* Creates list of users with given input array - *Description:* *No Description* + *Description:* - || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/user/createWithArray{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - ----- -h4. Parameters -h5. Body Parameter + h4. Parameters + + h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |body |List of user object |(/) | | | + |user |List of user object |(/) | | | + ----- -h4. Responses - || Status Code | {status:colour=Green|title=0|subtle=false} | - || Message | successful operation | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "successful operation", - "content" : { } -}{code} | - -{panel} + h4. Responses + *Status Code:* 0 + *Message:* successful operation + {code:title=Response Type} + {code} + See [#models] -h3. createUsersWithListInput -{panel:title=createUsersWithListInput|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + + + {code:title=Response Schema |collapse=true} +{ + "description" : "successful operation", + "content" : { } +} + {code} + ---- + + h3. createUsersWithListInput + {status:colour=Yellow|title=post|subtle=false} + {code} + post /user/createWithList + {code} *Summary:* Creates list of users with given input array - *Description:* *No Description* + *Description:* - || HttpMethod | {status:colour=Yellow|title=post|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/user/createWithList{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - ----- -h4. Parameters -h5. Body Parameter + h4. Parameters + + h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |body |List of user object |(/) | | | + |user |List of user object |(/) | | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=0|subtle=false} | - || Message | successful operation | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "successful operation", - "content" : { } -}{code} | - -{panel} + + + h4. Responses + *Status Code:* 0 + *Message:* successful operation + {code:title=Response Type} + + {code} + See [#models] -h3. deleteUser -{panel:title=deleteUser|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + {code:title=Response Schema |collapse=true} +{ + "description" : "successful operation", + "content" : { } +} + {code} + ---- + + h3. deleteUser + {status:colour=Yellow|title=delete|subtle=false} + {code} + delete /user/{username} + {code} *Summary:* Delete user *Description:* This can only be done by the logged in user. - || HttpMethod | {status:colour=Yellow|title=delete|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/user/{username}{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - ----- -h4. Parameters -h5. Path Parameters + + h4. Parameters + h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |username |The name that needs to be deleted |(/) |null | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=400|subtle=false} | - || Message | Invalid username supplied | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "Invalid username supplied", - "content" : { } -}{code} | - - || Status Code | {status:colour=Green|title=404|subtle=false} | - || Message | User not found | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "User not found", + + h4. Responses + *Status Code:* 400 + *Message:* Invalid username supplied + {code:title=Response Type} + + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ + "description" : "Invalid username supplied", "content" : { } -}{code} | - +} + {code} + *Status Code:* 404 + *Message:* User not found + {code:title=Response Type} -{panel} + {code} + See [#models] -h3. getUserByName -{panel:title=getUserByName|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + {code:title=Response Schema |collapse=true} +{ + "description" : "User not found", + "content" : { } +} + {code} + ---- + + h3. getUserByName + {status:colour=Yellow|title=get|subtle=false} + {code} + get /user/{username} + {code} *Summary:* Get user by user name - *Description:* *No Description* + *Description:* - || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/user/{username}{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | ----- -h4. Parameters -h5. Path Parameters + + h4. Parameters + h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |username |The name that needs to be fetched. Use user1 for testing. |(/) |null | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=200|subtle=false} | - || Message | successful operation | - || Response Type | User | - || Response Model | [User Model|#UserModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + + + h4. Responses + *Status Code:* 200 + *Message:* successful operation + {code:title=Response Type} +User + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ "description" : "successful operation", "content" : { "application/xml" : { @@ -833,63 +926,75 @@ h4. Responses } } } -}{code} | - +} + {code} + *Status Code:* 400 + *Message:* Invalid username supplied + {code:title=Response Type} + {code} + See [#models] - || Status Code | {status:colour=Green|title=400|subtle=false} | - || Message | Invalid username supplied | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "Invalid username supplied", - "content" : { } -}{code} | - - || Status Code | {status:colour=Green|title=404|subtle=false} | - || Message | User not found | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "User not found", + {code:title=Response Schema |collapse=true} +{ + "description" : "Invalid username supplied", "content" : { } -}{code} | - +} + {code} + *Status Code:* 404 + *Message:* User not found + {code:title=Response Type} -{panel} + {code} + See [#models] -h3. loginUser -{panel:title=loginUser|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + {code:title=Response Schema |collapse=true} +{ + "description" : "User not found", + "content" : { } +} + {code} + ---- + + h3. loginUser + {status:colour=Yellow|title=get|subtle=false} + {code} + get /user/login + {code} *Summary:* Logs user into the system - *Description:* *No Description* + *Description:* - || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/user/login{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - || Produces | {noformat:nopanel=true}application/xmlapplication/json{noformat} | ----- -h4. Parameters + + h4. Parameters -h5. Query Parameters + h5. Query Parameters ||Name||Description||Required||Default||Pattern|| |username |The user name for login |(/) |null | | + |password |The password for login in clear text |(/) |null | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=200|subtle=false} | - || Message | successful operation | - || Response Type | String | - || Response Model | [String Model|#StringModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + + + h4. Responses + *Status Code:* 200 + *Message:* successful operation + {code:title=Response Type} +String + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ "description" : "successful operation", "headers" : { "X-Rate-Limit" : { @@ -919,151 +1024,156 @@ h4. Responses } } } -}{code} | - +} + {code} + *Status Code:* 400 + *Message:* Invalid username/password supplied + {code:title=Response Type} + + {code} + See [#models] - || Status Code | {status:colour=Green|title=400|subtle=false} | - || Message | Invalid username/password supplied | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + {code:title=Response Schema |collapse=true} +{ "description" : "Invalid username/password supplied", "content" : { } -}{code} | - +} + {code} + ---- + + h3. logoutUser + {status:colour=Yellow|title=get|subtle=false} + {code} + get /user/logout + {code} + *Summary:* Logs out current logged in user session + *Description:* -{panel} + h4. Parameters -h3. logoutUser -{panel:title=logoutUser|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} - *Summary:* Logs out current logged in user session - *Description:* *No Description* - || HttpMethod | {status:colour=Yellow|title=get|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/user/logout{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - ----- -h4. Parameters ----- -h4. Responses - || Status Code | {status:colour=Green|title=0|subtle=false} | - || Message | successful operation | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "successful operation", - "content" : { } -}{code} | - + h4. Responses + *Status Code:* 0 + *Message:* successful operation + {code:title=Response Type} -{panel} + {code} + See [#models] -h3. updateUser -{panel:title=updateUser|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} + {code:title=Response Schema |collapse=true} +{ + "description" : "successful operation", + "content" : { } +} + {code} + ---- + + h3. updateUser + {status:colour=Yellow|title=put|subtle=false} + {code} + put /user/{username} + {code} *Summary:* Updated user *Description:* This can only be done by the logged in user. - || HttpMethod | {status:colour=Yellow|title=put|subtle=false} | - || Protocol | {noformat:nopanel=true}http{noformat} | - || Path | {noformat:nopanel=true}/user/{username}{noformat} | - || Base Path | {noformat:nopanel=true}http://petstore.swagger.io/v2{noformat} | - ----- -h4. Parameters -h5. Path Parameters + + h4. Parameters + h5. Path Parameters ||Name||Description||Required||Default||Pattern|| |username |name that need to be deleted |(/) |null | | -h5. Body Parameter + h5. Body Parameter ||Name||Description||Required||Default||Pattern|| - |body |Updated user object |(/) | | | + |user |Updated user object |(/) | | | ----- -h4. Responses - || Status Code | {status:colour=Green|title=400|subtle=false} | - || Message | Invalid user supplied | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ + + + + h4. Responses + *Status Code:* 400 + *Message:* Invalid user supplied + {code:title=Response Type} + + {code} + See [#models] + + + + {code:title=Response Schema |collapse=true} +{ "description" : "Invalid user supplied", "content" : { } -}{code} | - +} + {code} + *Status Code:* 404 + *Message:* User not found + {code:title=Response Type} + {code} + See [#models] - || Status Code | {status:colour=Green|title=404|subtle=false} | - || Message | User not found | - || Response Type | | - || Response Model | [ Model|#ModelAnchor|Jump to model] | - || Response Schema | {code:collapse=true}{ - "description" : "User not found", - "content" : { } -}{code} | - -{panel} + {code:title=Response Schema |collapse=true} +{ + "description" : "User not found", + "content" : { } +} + {code} + ---- -{anchor:models} h2. Models - {anchor:ApiResponseModelAnchor} h3. ApiResponse ||Field Name||Required||Type||Description|| - |code |(x) |{noformat:nopanel=true}Integer{noformat} | | - |type |(x) |{noformat:nopanel=true}String{noformat} | | - |message |(x) |{noformat:nopanel=true}String{noformat} | | - {anchor:CategoryModelAnchor} + |code | |Integer | | + |type | |String | | + |message | |String | | h3. Category ||Field Name||Required||Type||Description|| - |id |(x) |{noformat:nopanel=true}Long{noformat} | | - |name |(x) |{noformat:nopanel=true}String{noformat} | | - {anchor:OrderModelAnchor} + |id | |Long | | + |name | |String | | h3. Order ||Field Name||Required||Type||Description|| - |id |(x) |{noformat:nopanel=true}Long{noformat} | | - |petId |(x) |{noformat:nopanel=true}Long{noformat} | | - |quantity |(x) |{noformat:nopanel=true}Integer{noformat} | | - |shipDate |(x) |{noformat:nopanel=true}Date{noformat} | | - |status |(x) |{noformat:nopanel=true}String{noformat} |Order Status | - |complete |(x) |{noformat:nopanel=true}Boolean{noformat} | | - {anchor:PetModelAnchor} + |id | |Long | | + |petId | |Long | | + |quantity | |Integer | | + |shipDate | |Date | | + |status | |String |Order Status | + |complete | |Boolean | | h3. Pet ||Field Name||Required||Type||Description|| - |id |(x) |{noformat:nopanel=true}Long{noformat} | | - |category |(x) |{noformat:nopanel=true}Category{noformat} | | - |name |(/) |{noformat:nopanel=true}String{noformat} | | - |photoUrls |(/) |{noformat:nopanel=true}array[String]{noformat} | | - |tags |(x) |{noformat:nopanel=true}array[Tag]{noformat} | | - |status |(x) |{noformat:nopanel=true}String{noformat} |pet status in the store | - {anchor:TagModelAnchor} + |id | |Long | | + |category | |Category | | + |name | |String | | + |photoUrls | |array[String] | | + |tags | |array[Tag] | | + |status | |String |pet status in the store | h3. Tag ||Field Name||Required||Type||Description|| - |id |(x) |{noformat:nopanel=true}Long{noformat} | | - |name |(x) |{noformat:nopanel=true}String{noformat} | | - {anchor:UserModelAnchor} + |id | |Long | | + |name | |String | | h3. User ||Field Name||Required||Type||Description|| - |id |(x) |{noformat:nopanel=true}Long{noformat} | | - |username |(x) |{noformat:nopanel=true}String{noformat} | | - |firstName |(x) |{noformat:nopanel=true}String{noformat} | | - |lastName |(x) |{noformat:nopanel=true}String{noformat} | | - |email |(x) |{noformat:nopanel=true}String{noformat} | | - |password |(x) |{noformat:nopanel=true}String{noformat} | | - |phone |(x) |{noformat:nopanel=true}String{noformat} | | - |userStatus |(x) |{noformat:nopanel=true}Integer{noformat} |User Status | + |id | |Long | | + |username | |String | | + |firstName | |String | | + |lastName | |String | | + |email | |String | | + |password | |String | | + |phone | |String | | + |userStatus | |Integer |User Status | diff --git a/samples/documentation/dynamic-html/.openapi-generator/VERSION b/samples/documentation/dynamic-html/.openapi-generator/VERSION index bfbf77eb7fad..14900cee60e8 100644 --- a/samples/documentation/dynamic-html/.openapi-generator/VERSION +++ b/samples/documentation/dynamic-html/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/dynamic-html/docs/operations/PetApi.html b/samples/documentation/dynamic-html/docs/operations/PetApi.html index 3253976d7385..75a5fda414f8 100644 --- a/samples/documentation/dynamic-html/docs/operations/PetApi.html +++ b/samples/documentation/dynamic-html/docs/operations/PetApi.html @@ -20,7 +20,7 @@

    Parameters

    Body: - body + Pet Pet(Pet)

    Pet object that needs to be added to the store

    @@ -151,7 +151,7 @@

    Parameters

    Body: - body + Pet Pet(Pet)

    Pet object that needs to be added to the store

    diff --git a/samples/documentation/dynamic-html/docs/operations/StoreApi.html b/samples/documentation/dynamic-html/docs/operations/StoreApi.html index f0bbff63e859..cb880712d31a 100644 --- a/samples/documentation/dynamic-html/docs/operations/StoreApi.html +++ b/samples/documentation/dynamic-html/docs/operations/StoreApi.html @@ -81,7 +81,7 @@

    Parameters

    Body: - body + Order Order(Order)

    order placed for purchasing the pet

    diff --git a/samples/documentation/dynamic-html/docs/operations/UserApi.html b/samples/documentation/dynamic-html/docs/operations/UserApi.html index ecc44e43656a..f3940e0f4bde 100644 --- a/samples/documentation/dynamic-html/docs/operations/UserApi.html +++ b/samples/documentation/dynamic-html/docs/operations/UserApi.html @@ -20,7 +20,7 @@

    Parameters

    Body: - body + User User(User)

    Created user object

    @@ -44,8 +44,8 @@

    Parameters

    Body: - body - List(User) + User + List(array)

    List of user object

    @@ -68,8 +68,8 @@

    Parameters

    Body: - body - List(User) + User + List(array)

    List of user object

    @@ -199,7 +199,7 @@

    Parameters

    Body: - body + User User(User)

    Updated user object

    diff --git a/samples/documentation/html.md/.openapi-generator/VERSION b/samples/documentation/html.md/.openapi-generator/VERSION index bfbf77eb7fad..096bf47efe31 100644 --- a/samples/documentation/html.md/.openapi-generator/VERSION +++ b/samples/documentation/html.md/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html.md/index.html b/samples/documentation/html.md/index.html index 63ef7f704b0c..7545df2e3190 100644 --- a/samples/documentation/html.md/index.html +++ b/samples/documentation/html.md/index.html @@ -189,8 +189,8 @@

    An API with more Markdown in summary, description,
  • in schema (model) member descriptions
  • - -
    Contact Info: team@openapitools.org
    +
    More information: https://helloreverb.com
    +
    Contact Info: hello@helloreverb.com
    Version: 0.1.0
    BasePath:/v1
    All rights reserved
    @@ -226,7 +226,7 @@

    Query parameters

    seed (required)
    -
    Query Parameter — A random number seed. default: null
    +
    Query Parameter — A random number seed.
    @@ -242,8 +242,8 @@

    Example data

    Content-Type: */*
    {
       "sequence" : 1,
    -  "seed" : 6.027456183070403,
    -  "value" : 0.8008281904610115
    +  "seed" : 6.02745618307040320615897144307382404804229736328125,
    +  "value" : 0.80082819046101150206595775671303272247314453125
     }

    Produces

    diff --git a/samples/documentation/html/.openapi-generator/VERSION b/samples/documentation/html/.openapi-generator/VERSION index bfbf77eb7fad..d077ffb477a4 100644 --- a/samples/documentation/html/.openapi-generator/VERSION +++ b/samples/documentation/html/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.4-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html/index.html b/samples/documentation/html/index.html index 0c50abd609f7..387ee5572165 100644 --- a/samples/documentation/html/index.html +++ b/samples/documentation/html/index.html @@ -246,7 +246,7 @@

    Consumes

    Request body

    -
    body Pet (required)
    +
    Pet Pet (required)
    Body Parameter
    @@ -551,7 +551,7 @@

    Consumes

    Request body

    -
    body Pet (required)
    +
    Pet Pet (required)
    Body Parameter
    @@ -829,7 +829,7 @@

    404

    Request body

    -
    body Order (required)
    +
    Order Order (required)
    Body Parameter
    @@ -896,7 +896,7 @@

    User

    Request body

    -
    body User (required)
    +
    User User (required)
    Body Parameter
    @@ -927,7 +927,7 @@

    default

    Request body

    -
    body User (required)
    +
    User array (required)
    Body Parameter
    @@ -958,7 +958,7 @@

    default

    Request body

    -
    body User (required)
    +
    User array (required)
    Body Parameter
    @@ -1171,7 +1171,7 @@

    Path parameters

    Request body

    -
    body User (required)
    +
    User User (required)
    Body Parameter
    diff --git a/samples/documentation/html2/.openapi-generator/VERSION b/samples/documentation/html2/.openapi-generator/VERSION index bfbf77eb7fad..14900cee60e8 100644 --- a/samples/documentation/html2/.openapi-generator/VERSION +++ b/samples/documentation/html2/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/html2/index.html b/samples/documentation/html2/index.html index ea3898370661..2b37cc2b4bb3 100644 --- a/samples/documentation/html2/index.html +++ b/samples/documentation/html2/index.html @@ -1144,16 +1144,15 @@

    Usage and SDK Samples

    petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); - Pet body = ; // Pet | + Pet pet = ; // Pet | try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); } } -} - +}
    @@ -1163,9 +1162,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet body = ; // Pet | + Pet pet = ; // Pet | try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -1183,12 +1182,12 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Pet *body = ; // +Pet *pet = ; // PetApi *apiInstance = [[PetApi alloc] init]; // Add a new pet to the store -[apiInstance addPetWith:body +[apiInstance addPetWith:pet completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); @@ -1206,7 +1205,7 @@

    Usage and SDK Samples

    petstore_auth.accessToken = "YOUR ACCESS TOKEN" var api = new OpenApiPetstore.PetApi() -var body = ; // {Pet} +var pet = ; // {Pet} var callback = function(error, data, response) { if (error) { @@ -1215,7 +1214,7 @@

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.addPet(body, callback); +api.addPet(pet, callback);
    @@ -1240,12 +1239,12 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var body = new Pet(); // Pet | + var pet = new Pet(); // Pet | try { // Add a new pet to the store - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (Exception e) { @@ -1265,10 +1264,10 @@

    Usage and SDK Samples

    OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new OpenAPITools\Client\Api\PetApi(); -$body = ; // Pet | +$pet = ; // Pet | try { - $api_instance->addPet($body); + $api_instance->addPet($pet); } catch (Exception $e) { echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL; } @@ -1284,10 +1283,10 @@

    Usage and SDK Samples

    $WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::OPenAPIClient::PetApi->new(); -my $body = WWW::OPenAPIClient::Object::Pet->new(); # Pet | +my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | eval { - $api_instance->addPet(body => $body); + $api_instance->addPet(pet => $pet); }; if ($@) { warn "Exception when calling PetApi->addPet: $@\n"; @@ -1306,11 +1305,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -body = # Pet | +pet = # Pet | try: # Add a new pet to the store - api_instance.add_pet(body) + api_instance.add_pet(pet) except ApiException as e: print("Exception when calling PetApi->addPet: %s\n" % e)
    @@ -1319,10 +1318,10 @@

    Usage and SDK Samples

    extern crate PetApi;
     
     pub fn main() {
    -    let body = ; // Pet
    +    let pet = ; // Pet
     
         let mut context = PetApi::Context::default();
    -    let result = client.addPet(body, &context).wait();
    +    let result = client.addPet(pet, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -1355,7 +1354,7 @@ 

    Parameters

    Name Description - body * + pet *

    Pet object that needs to be added to the store

    -
    +
    @@ -1474,8 +1473,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} -
    +}
    @@ -1506,8 +1504,8 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // Pet id to delete (default to null) -String *apiKey = apiKey_example; // (optional) (default to null) +Long *petId = 789; // Pet id to delete +String *apiKey = apiKey_example; // (optional) PetApi *apiInstance = [[PetApi alloc] init]; @@ -1568,8 +1566,8 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | Pet id to delete (default to null) - var apiKey = apiKey_example; // String | (optional) (default to null) + var petId = 789; // Long | Pet id to delete + var apiKey = apiKey_example; // String | (optional) try { @@ -1637,8 +1635,8 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | Pet id to delete (default to null) -apiKey = apiKey_example # String | (optional) (default to null) +petId = 789 # Long | Pet id to delete +apiKey = apiKey_example # String | (optional) try: # Deletes a pet @@ -1831,8 +1829,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} - +}
    @@ -1863,7 +1860,7 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -array[String] *status = ; // Status values that need to be considered for filter (default to null) +array[String] *status = ; // Status values that need to be considered for filter PetApi *apiInstance = [[PetApi alloc] init]; @@ -1923,7 +1920,7 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var status = new array[String](); // array[String] | Status values that need to be considered for filter (default to null) + var status = new array[String](); // array[String] | Status values that need to be considered for filter try { @@ -1992,7 +1989,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -status = # array[String] | Status values that need to be considered for filter (default to null) +status = # array[String] | Status values that need to be considered for filter try: # Finds Pets by status @@ -2230,8 +2227,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} - +}
    @@ -2262,7 +2258,7 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -array[String] *tags = ; // Tags to filter by (default to null) +array[String] *tags = ; // Tags to filter by PetApi *apiInstance = [[PetApi alloc] init]; @@ -2322,7 +2318,7 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var tags = new array[String](); // array[String] | Tags to filter by (default to null) + var tags = new array[String](); // array[String] | Tags to filter by try { @@ -2391,7 +2387,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -tags = # array[String] | Tags to filter by (default to null) +tags = # array[String] | Tags to filter by try: # Finds Pets by tags @@ -2631,8 +2627,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} - +}
    @@ -2665,7 +2660,7 @@

    Usage and SDK Samples

    // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; -Long *petId = 789; // ID of pet to return (default to null) +Long *petId = 789; // ID of pet to return PetApi *apiInstance = [[PetApi alloc] init]; @@ -2729,7 +2724,7 @@

    Usage and SDK Samples

    // Configuration.Default.ApiKeyPrefix.Add("api_key", "Bearer"); var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet to return (default to null) + var petId = 789; // Long | ID of pet to return try { @@ -2804,7 +2799,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet to return (default to null) +petId = 789 # Long | ID of pet to return try: # Find pet by ID @@ -3042,16 +3037,15 @@

    Usage and SDK Samples

    petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); - Pet body = ; // Pet | + Pet pet = ; // Pet | try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); } } -} - +}
    @@ -3061,9 +3055,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet body = ; // Pet | + Pet pet = ; // Pet | try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -3081,12 +3075,12 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Pet *body = ; // +Pet *pet = ; // PetApi *apiInstance = [[PetApi alloc] init]; // Update an existing pet -[apiInstance updatePetWith:body +[apiInstance updatePetWith:pet completionHandler: ^(NSError* error) { if (error) { NSLog(@"Error: %@", error); @@ -3104,7 +3098,7 @@

    Usage and SDK Samples

    petstore_auth.accessToken = "YOUR ACCESS TOKEN" var api = new OpenApiPetstore.PetApi() -var body = ; // {Pet} +var pet = ; // {Pet} var callback = function(error, data, response) { if (error) { @@ -3113,7 +3107,7 @@

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.updatePet(body, callback); +api.updatePet(pet, callback);
    @@ -3138,12 +3132,12 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var body = new Pet(); // Pet | + var pet = new Pet(); // Pet | try { // Update an existing pet - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (Exception e) { @@ -3163,10 +3157,10 @@

    Usage and SDK Samples

    OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $api_instance = new OpenAPITools\Client\Api\PetApi(); -$body = ; // Pet | +$pet = ; // Pet | try { - $api_instance->updatePet($body); + $api_instance->updatePet($pet); } catch (Exception $e) { echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL; } @@ -3182,10 +3176,10 @@

    Usage and SDK Samples

    $WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN'; my $api_instance = WWW::OPenAPIClient::PetApi->new(); -my $body = WWW::OPenAPIClient::Object::Pet->new(); # Pet | +my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | eval { - $api_instance->updatePet(body => $body); + $api_instance->updatePet(pet => $pet); }; if ($@) { warn "Exception when calling PetApi->updatePet: $@\n"; @@ -3204,11 +3198,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -body = # Pet | +pet = # Pet | try: # Update an existing pet - api_instance.update_pet(body) + api_instance.update_pet(pet) except ApiException as e: print("Exception when calling PetApi->updatePet: %s\n" % e)
    @@ -3217,10 +3211,10 @@

    Usage and SDK Samples

    extern crate PetApi;
     
     pub fn main() {
    -    let body = ; // Pet
    +    let pet = ; // Pet
     
         let mut context = PetApi::Context::default();
    -    let result = client.updatePet(body, &context).wait();
    +    let result = client.updatePet(pet, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -3253,7 +3247,7 @@ 

    Parameters

    Name Description - body * + pet *

    Pet object that needs to be added to the store

    -
    +
    @@ -3417,8 +3411,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} -
    +}
    @@ -3450,7 +3443,7 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // ID of pet that needs to be updated (default to null) +Long *petId = 789; // ID of pet that needs to be updated String *name = name_example; // Updated name of the pet (optional) (default to null) String *status = status_example; // Updated status of the pet (optional) (default to null) @@ -3515,7 +3508,7 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet that needs to be updated (default to null) + var petId = 789; // Long | ID of pet that needs to be updated var name = name_example; // String | Updated name of the pet (optional) (default to null) var status = status_example; // String | Updated status of the pet (optional) (default to null) @@ -3587,7 +3580,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet that needs to be updated (default to null) +petId = 789 # Long | ID of pet that needs to be updated name = name_example # String | Updated name of the pet (optional) (default to null) status = status_example # String | Updated status of the pet (optional) (default to null) @@ -3808,8 +3801,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} - +}
    @@ -3842,7 +3834,7 @@

    Usage and SDK Samples

    // Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; -Long *petId = 789; // ID of pet to update (default to null) +Long *petId = 789; // ID of pet to update String *additionalMetadata = additionalMetadata_example; // Additional data to pass to server (optional) (default to null) File *file = BINARY_DATA_HERE; // file to upload (optional) (default to null) @@ -3910,7 +3902,7 @@

    Usage and SDK Samples

    Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var petId = 789; // Long | ID of pet to update (default to null) + var petId = 789; // Long | ID of pet to update var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server (optional) (default to null) var file = BINARY_DATA_HERE; // File | file to upload (optional) (default to null) @@ -3985,7 +3977,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.PetApi() -petId = 789 # Long | ID of pet to update (default to null) +petId = 789 # Long | ID of pet to update additionalMetadata = additionalMetadata_example # String | Additional data to pass to server (optional) (default to null) file = BINARY_DATA_HERE # File | file to upload (optional) (default to null) @@ -4244,8 +4236,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} - +}
    @@ -4270,7 +4261,7 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *orderId = orderId_example; // ID of the order that needs to be deleted (default to null)
    +                              
    String *orderId = orderId_example; // ID of the order that needs to be deleted
     
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
    @@ -4319,7 +4310,7 @@ 

    Usage and SDK Samples

    { var apiInstance = new StoreApi(); - var orderId = orderId_example; // String | ID of the order that needs to be deleted (default to null) + var orderId = orderId_example; // String | ID of the order that needs to be deleted try { @@ -4376,7 +4367,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.StoreApi() -orderId = orderId_example # String | ID of the order that needs to be deleted (default to null) +orderId = orderId_example # String | ID of the order that needs to be deleted try: # Delete purchase order by ID @@ -4554,8 +4545,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} -
    +}
    @@ -4882,8 +4872,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} - +}
    @@ -4909,7 +4898,7 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    Long *orderId = 789; // ID of pet that needs to be fetched (default to null)
    +                              
    Long *orderId = 789; // ID of pet that needs to be fetched
     
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
    @@ -4961,7 +4950,7 @@ 

    Usage and SDK Samples

    { var apiInstance = new StoreApi(); - var orderId = 789; // Long | ID of pet that needs to be fetched (default to null) + var orderId = 789; // Long | ID of pet that needs to be fetched try { @@ -5021,7 +5010,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.StoreApi() -orderId = 789 # Long | ID of pet that needs to be fetched (default to null) +orderId = 789 # Long | ID of pet that needs to be fetched try: # Find purchase order by ID @@ -5254,17 +5243,16 @@

    Usage and SDK Samples

    public static void main(String[] args) { StoreApi apiInstance = new StoreApi(); - Order body = ; // Order | + Order order = ; // Order | try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); e.printStackTrace(); } } -} -
    +}
    @@ -5274,9 +5262,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { StoreApi apiInstance = new StoreApi(); - Order body = ; // Order | + Order order = ; // Order | try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -5290,12 +5278,12 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    Order *body = ; // 
    +                              
    Order *order = ; // 
     
     StoreApi *apiInstance = [[StoreApi alloc] init];
     
     // Place an order for a pet
    -[apiInstance placeOrderWith:body
    +[apiInstance placeOrderWith:order
                   completionHandler: ^(Order output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
    @@ -5311,7 +5299,7 @@ 

    Usage and SDK Samples

    var OpenApiPetstore = require('open_api_petstore');
     
     var api = new OpenApiPetstore.StoreApi()
    -var body = ; // {Order} 
    +var order = ; // {Order} 
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -5320,7 +5308,7 @@ 

    Usage and SDK Samples

    console.log('API called successfully. Returned data: ' + data); } }; -api.placeOrder(body, callback); +api.placeOrder(order, callback);
    @@ -5342,12 +5330,12 @@

    Usage and SDK Samples

    { var apiInstance = new StoreApi(); - var body = new Order(); // Order | + var order = new Order(); // Order | try { // Place an order for a pet - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); Debug.WriteLine(result); } catch (Exception e) @@ -5365,10 +5353,10 @@

    Usage and SDK Samples

    require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\StoreApi(); -$body = ; // Order | +$order = ; // Order | try { - $result = $api_instance->placeOrder($body); + $result = $api_instance->placeOrder($order); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL; @@ -5382,10 +5370,10 @@

    Usage and SDK Samples

    use WWW::OPenAPIClient::StoreApi; my $api_instance = WWW::OPenAPIClient::StoreApi->new(); -my $body = WWW::OPenAPIClient::Object::Order->new(); # Order | +my $order = WWW::OPenAPIClient::Object::Order->new(); # Order | eval { - my $result = $api_instance->placeOrder(body => $body); + my $result = $api_instance->placeOrder(order => $order); print Dumper($result); }; if ($@) { @@ -5402,11 +5390,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.StoreApi() -body = # Order | +order = # Order | try: # Place an order for a pet - api_response = api_instance.place_order(body) + api_response = api_instance.place_order(order) pprint(api_response) except ApiException as e: print("Exception when calling StoreApi->placeOrder: %s\n" % e)
    @@ -5416,10 +5404,10 @@

    Usage and SDK Samples

    extern crate StoreApi;
     
     pub fn main() {
    -    let body = ; // Order
    +    let order = ; // Order
     
         let mut context = StoreApi::Context::default();
    -    let result = client.placeOrder(body, &context).wait();
    +    let result = client.placeOrder(order, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -5442,7 +5430,7 @@ 

    Parameters

    Name Description - body * + order *

    order placed for purchasing the pet

    -
    +
    @@ -5616,16 +5604,15 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - User body = ; // User | + User user = ; // User | try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); } } -} -
    +}
    @@ -5635,9 +5622,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - User body = ; // User | + User user = ; // User | try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -5650,12 +5637,12 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    User *body = ; // 
    +                              
    User *user = ; // 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Create user
    -[apiInstance createUserWith:body
    +[apiInstance createUserWith:user
                   completionHandler: ^(NSError* error) {
                                 if (error) {
                                     NSLog(@"Error: %@", error);
    @@ -5668,7 +5655,7 @@ 

    Usage and SDK Samples

    var OpenApiPetstore = require('open_api_petstore');
     
     var api = new OpenApiPetstore.UserApi()
    -var body = ; // {User} 
    +var user = ; // {User} 
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -5677,7 +5664,7 @@ 

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.createUser(body, callback); +api.createUser(user, callback);
    @@ -5699,12 +5686,12 @@

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var body = new User(); // User | + var user = new User(); // User | try { // Create user - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (Exception e) { @@ -5721,10 +5708,10 @@

    Usage and SDK Samples

    require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$body = ; // User | +$user = ; // User | try { - $api_instance->createUser($body); + $api_instance->createUser($user); } catch (Exception $e) { echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL; } @@ -5737,10 +5724,10 @@

    Usage and SDK Samples

    use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $body = WWW::OPenAPIClient::Object::User->new(); # User | +my $user = WWW::OPenAPIClient::Object::User->new(); # User | eval { - $api_instance->createUser(body => $body); + $api_instance->createUser(user => $user); }; if ($@) { warn "Exception when calling UserApi->createUser: $@\n"; @@ -5756,11 +5743,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -body = # User | +user = # User | try: # Create user - api_instance.create_user(body) + api_instance.create_user(user) except ApiException as e: print("Exception when calling UserApi->createUser: %s\n" % e)
    @@ -5769,10 +5756,10 @@

    Usage and SDK Samples

    extern crate UserApi;
     
     pub fn main() {
    -    let body = ; // User
    +    let user = ; // User
     
         let mut context = UserApi::Context::default();
    -    let result = client.createUser(body, &context).wait();
    +    let result = client.createUser(user, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -5795,7 +5782,7 @@ 

    Parameters

    Name Description - body * + user *

    Created user object

    -
    +
    @@ -5900,16 +5887,15 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] body = ; // array[User] | + array[User] user = ; // array[User] | try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); } } -} -
    +}
    @@ -5919,9 +5905,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] body = ; // array[User] | + array[User] user = ; // array[User] | try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -5934,12 +5920,12 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    array[User] *body = ; // 
    +                              
    array[User] *user = ; // 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Creates list of users with given input array
    -[apiInstance createUsersWithArrayInputWith:body
    +[apiInstance createUsersWithArrayInputWith:user
                   completionHandler: ^(NSError* error) {
                                 if (error) {
                                     NSLog(@"Error: %@", error);
    @@ -5952,7 +5938,7 @@ 

    Usage and SDK Samples

    var OpenApiPetstore = require('open_api_petstore');
     
     var api = new OpenApiPetstore.UserApi()
    -var body = ; // {array[User]} 
    +var user = ; // {array[User]} 
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -5961,7 +5947,7 @@ 

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.createUsersWithArrayInput(body, callback); +api.createUsersWithArrayInput(user, callback);
    @@ -5983,12 +5969,12 @@

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var body = new array[User](); // array[User] | + var user = new array[User](); // array[User] | try { // Creates list of users with given input array - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (Exception e) { @@ -6005,10 +5991,10 @@

    Usage and SDK Samples

    require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$body = ; // array[User] | +$user = ; // array[User] | try { - $api_instance->createUsersWithArrayInput($body); + $api_instance->createUsersWithArrayInput($user); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL; } @@ -6021,10 +6007,10 @@

    Usage and SDK Samples

    use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $body = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | +my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | eval { - $api_instance->createUsersWithArrayInput(body => $body); + $api_instance->createUsersWithArrayInput(user => $user); }; if ($@) { warn "Exception when calling UserApi->createUsersWithArrayInput: $@\n"; @@ -6040,11 +6026,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -body = # array[User] | +user = # array[User] | try: # Creates list of users with given input array - api_instance.create_users_with_array_input(body) + api_instance.create_users_with_array_input(user) except ApiException as e: print("Exception when calling UserApi->createUsersWithArrayInput: %s\n" % e)
    @@ -6053,10 +6039,10 @@

    Usage and SDK Samples

    extern crate UserApi;
     
     pub fn main() {
    -    let body = ; // array[User]
    +    let user = ; // array[User]
     
         let mut context = UserApi::Context::default();
    -    let result = client.createUsersWithArrayInput(body, &context).wait();
    +    let result = client.createUsersWithArrayInput(user, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -6079,7 +6065,7 @@ 

    Parameters

    Name Description - body * + user *

    List of user object

    -
    +
    @@ -6184,16 +6170,15 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] body = ; // array[User] | + array[User] user = ; // array[User] | try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); } } -} -
    +}
    @@ -6203,9 +6188,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] body = ; // array[User] | + array[User] user = ; // array[User] | try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -6218,12 +6203,12 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    array[User] *body = ; // 
    +                              
    array[User] *user = ; // 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Creates list of users with given input array
    -[apiInstance createUsersWithListInputWith:body
    +[apiInstance createUsersWithListInputWith:user
                   completionHandler: ^(NSError* error) {
                                 if (error) {
                                     NSLog(@"Error: %@", error);
    @@ -6236,7 +6221,7 @@ 

    Usage and SDK Samples

    var OpenApiPetstore = require('open_api_petstore');
     
     var api = new OpenApiPetstore.UserApi()
    -var body = ; // {array[User]} 
    +var user = ; // {array[User]} 
     
     var callback = function(error, data, response) {
       if (error) {
    @@ -6245,7 +6230,7 @@ 

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.createUsersWithListInput(body, callback); +api.createUsersWithListInput(user, callback);
    @@ -6267,12 +6252,12 @@

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var body = new array[User](); // array[User] | + var user = new array[User](); // array[User] | try { // Creates list of users with given input array - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (Exception e) { @@ -6289,10 +6274,10 @@

    Usage and SDK Samples

    require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new OpenAPITools\Client\Api\UserApi(); -$body = ; // array[User] | +$user = ; // array[User] | try { - $api_instance->createUsersWithListInput($body); + $api_instance->createUsersWithListInput($user); } catch (Exception $e) { echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL; } @@ -6305,10 +6290,10 @@

    Usage and SDK Samples

    use WWW::OPenAPIClient::UserApi; my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $body = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | +my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | eval { - $api_instance->createUsersWithListInput(body => $body); + $api_instance->createUsersWithListInput(user => $user); }; if ($@) { warn "Exception when calling UserApi->createUsersWithListInput: $@\n"; @@ -6324,11 +6309,11 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -body = # array[User] | +user = # array[User] | try: # Creates list of users with given input array - api_instance.create_users_with_list_input(body) + api_instance.create_users_with_list_input(user) except ApiException as e: print("Exception when calling UserApi->createUsersWithListInput: %s\n" % e)
    @@ -6337,10 +6322,10 @@

    Usage and SDK Samples

    extern crate UserApi;
     
     pub fn main() {
    -    let body = ; // array[User]
    +    let user = ; // array[User]
     
         let mut context = UserApi::Context::default();
    -    let result = client.createUsersWithListInput(body, &context).wait();
    +    let result = client.createUsersWithListInput(user, &context).wait();
         println!("{:?}", result);
     
     }
    @@ -6363,7 +6348,7 @@ 

    Parameters

    Name Description - body * + user *

    List of user object

    -
    +
    @@ -6476,8 +6461,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} -
    +}
    @@ -6502,7 +6486,7 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *username = username_example; // The name that needs to be deleted (default to null)
    +                              
    String *username = username_example; // The name that needs to be deleted
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -6551,7 +6535,7 @@ 

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var username = username_example; // String | The name that needs to be deleted (default to null) + var username = username_example; // String | The name that needs to be deleted try { @@ -6608,7 +6592,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The name that needs to be deleted (default to null) +username = username_example # String | The name that needs to be deleted try: # Delete user @@ -6780,8 +6764,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} -
    +}
    @@ -6807,7 +6790,7 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *username = username_example; // The name that needs to be fetched. Use user1 for testing. (default to null)
    +                              
    String *username = username_example; // The name that needs to be fetched. Use user1 for testing.
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -6859,7 +6842,7 @@ 

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. (default to null) + var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { @@ -6919,7 +6902,7 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The name that needs to be fetched. Use user1 for testing. (default to null) +username = username_example # String | The name that needs to be fetched. Use user1 for testing. try: # Get user by user name @@ -7159,8 +7142,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} -
    +}
    @@ -7187,8 +7169,8 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *username = username_example; // The user name for login (default to null)
    -String *password = password_example; // The password for login in clear text (default to null)
    +                              
    String *username = username_example; // The user name for login
    +String *password = password_example; // The password for login in clear text
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
    @@ -7242,8 +7224,8 @@ 

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var username = username_example; // String | The user name for login (default to null) - var password = password_example; // String | The password for login in clear text (default to null) + var username = username_example; // String | The user name for login + var password = password_example; // String | The password for login in clear text try { @@ -7305,8 +7287,8 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | The user name for login (default to null) -password = password_example # String | The password for login in clear text (default to null) +username = username_example # String | The user name for login +password = password_example # String | The password for login in clear text try: # Logs user into the system @@ -7586,8 +7568,7 @@

    Usage and SDK Samples

    e.printStackTrace(); } } -} -
    +}
    @@ -7821,16 +7802,15 @@

    Usage and SDK Samples

    UserApi apiInstance = new UserApi(); String username = username_example; // String | name that need to be deleted - User body = ; // User | + User user = ; // User | try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); } } -} - +}
    @@ -7841,9 +7821,9 @@

    Usage and SDK Samples

    public static void main(String[] args) { UserApi apiInstance = new UserApi(); String username = username_example; // String | name that need to be deleted - User body = ; // User | + User user = ; // User | try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -7856,14 +7836,14 @@

    Usage and SDK Samples

    Coming Soon!
    -->
    -
    String *username = username_example; // name that need to be deleted (default to null)
    -User *body = ; // 
    +                              
    String *username = username_example; // name that need to be deleted
    +User *user = ; // 
     
     UserApi *apiInstance = [[UserApi alloc] init];
     
     // Updated user
     [apiInstance updateUserWith:username
    -    body:body
    +    user:user
                   completionHandler: ^(NSError* error) {
                                 if (error) {
                                     NSLog(@"Error: %@", error);
    @@ -7877,7 +7857,7 @@ 

    Usage and SDK Samples

    var api = new OpenApiPetstore.UserApi() var username = username_example; // {String} name that need to be deleted -var body = ; // {User} +var user = ; // {User} var callback = function(error, data, response) { if (error) { @@ -7886,7 +7866,7 @@

    Usage and SDK Samples

    console.log('API called successfully.'); } }; -api.updateUser(username, body, callback); +api.updateUser(username, user, callback);
    @@ -7908,13 +7888,13 @@

    Usage and SDK Samples

    { var apiInstance = new UserApi(); - var username = username_example; // String | name that need to be deleted (default to null) - var body = new User(); // User | + var username = username_example; // String | name that need to be deleted + var user = new User(); // User | try { // Updated user - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (Exception e) { @@ -7932,10 +7912,10 @@

    Usage and SDK Samples

    $api_instance = new OpenAPITools\Client\Api\UserApi(); $username = username_example; // String | name that need to be deleted -$body = ; // User | +$user = ; // User | try { - $api_instance->updateUser($username, $body); + $api_instance->updateUser($username, $user); } catch (Exception $e) { echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL; } @@ -7949,10 +7929,10 @@

    Usage and SDK Samples

    my $api_instance = WWW::OPenAPIClient::UserApi->new(); my $username = username_example; # String | name that need to be deleted -my $body = WWW::OPenAPIClient::Object::User->new(); # User | +my $user = WWW::OPenAPIClient::Object::User->new(); # User | eval { - $api_instance->updateUser(username => $username, body => $body); + $api_instance->updateUser(username => $username, user => $user); }; if ($@) { warn "Exception when calling UserApi->updateUser: $@\n"; @@ -7968,12 +7948,12 @@

    Usage and SDK Samples

    # create an instance of the API class api_instance = openapi_client.UserApi() -username = username_example # String | name that need to be deleted (default to null) -body = # User | +username = username_example # String | name that need to be deleted +user = # User | try: # Updated user - api_instance.update_user(username, body) + api_instance.update_user(username, user) except ApiException as e: print("Exception when calling UserApi->updateUser: %s\n" % e)
    @@ -7983,10 +7963,10 @@

    Usage and SDK Samples

    pub fn main() { let username = username_example; // String - let body = ; // User + let user = ; // User let mut context = UserApi::Context::default(); - let result = client.updateUser(username, body, &context).wait(); + let result = client.updateUser(username, user, &context).wait(); println!("{:?}", result); } @@ -8039,7 +8019,7 @@

    Parameters

    Name Description - body * + user *

    Updated user object

    -
    +
    diff --git a/samples/documentation/markdown/.openapi-generator/VERSION b/samples/documentation/markdown/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/documentation/markdown/.openapi-generator/VERSION +++ b/samples/documentation/markdown/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/documentation/markdown/Apis/StoreApi.md b/samples/documentation/markdown/Apis/StoreApi.md index 9f1c05ae2f8a..9b7ce9f21f0f 100644 --- a/samples/documentation/markdown/Apis/StoreApi.md +++ b/samples/documentation/markdown/Apis/StoreApi.md @@ -50,7 +50,7 @@ This endpoint does not need any parameter. ### Return type -[**Map**](..//Models/integer.md) +[**Map**](/Models/integer.md) ### Authorization @@ -77,7 +77,7 @@ Name | Type | Description | Notes ### Return type -[**Order**](..//Models/Order.md) +[**Order**](/Models/Order.md) ### Authorization @@ -98,11 +98,11 @@ Place an order for a pet Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](..//Models/Order.md)| order placed for purchasing the pet | + **body** | [**Order**](/Models/Order.md)| order placed for purchasing the pet | ### Return type -[**Order**](..//Models/Order.md) +[**Order**](/Models/Order.md) ### Authorization diff --git a/samples/documentation/markdown/Apis/UserApi.md b/samples/documentation/markdown/Apis/UserApi.md index 75321e5bb02b..f92b65c33449 100644 --- a/samples/documentation/markdown/Apis/UserApi.md +++ b/samples/documentation/markdown/Apis/UserApi.md @@ -26,7 +26,7 @@ Create user Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](..//Models/User.md)| Created user object | + **body** | [**User**](/Models/User.md)| Created user object | ### Return type @@ -51,7 +51,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List**](..//Models/User.md)| List of user object | + **body** | [**List**](/Models/User.md)| List of user object | ### Return type @@ -76,7 +76,7 @@ Creates list of users with given input array Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List**](..//Models/User.md)| List of user object | + **body** | [**List**](/Models/User.md)| List of user object | ### Return type @@ -132,7 +132,7 @@ Name | Type | Description | Notes ### Return type -[**User**](..//Models/User.md) +[**User**](/Models/User.md) ### Authorization @@ -158,7 +158,7 @@ Name | Type | Description | Notes ### Return type -[**String**](..//Models/string.md) +[**String**](/Models/string.md) ### Authorization @@ -204,7 +204,7 @@ Updated user Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **body** | [**User**](..//Models/User.md)| Updated user object | + **body** | [**User**](/Models/User.md)| Updated user object | ### Return type diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index bfbf77eb7fad..94bf4e677615 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT diff --git a/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION b/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION index bfbf77eb7fad..717311e32e3c 100644 --- a/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-restbed/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +unset \ No newline at end of file diff --git a/samples/server/petstore/cpp-restbed/api/PetApi.cpp b/samples/server/petstore/cpp-restbed/api/PetApi.cpp index cdb647763619..aadfcd871e8f 100644 --- a/samples/server/petstore/cpp-restbed/api/PetApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/PetApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -66,6 +66,9 @@ PetApiPetResource::PetApiPetResource() this->set_method_handler("PUT", std::bind(&PetApiPetResource::PUT_method_handler, this, std::placeholders::_1)); + + body = std::make_shared(); + } PetApiPetResource::~PetApiPetResource() @@ -178,6 +181,10 @@ PetApiPetPetIdResource::PetApiPetPetIdResource() this->set_method_handler("POST", std::bind(&PetApiPetPetIdResource::POST_method_handler, this, std::placeholders::_1)); + + petId = 0L; + apiKey = ""; + } PetApiPetPetIdResource::~PetApiPetPetIdResource() @@ -302,6 +309,8 @@ PetApiPetFindByStatusResource::PetApiPetFindByStatusResource() this->set_method_handler("GET", std::bind(&PetApiPetFindByStatusResource::GET_method_handler, this, std::placeholders::_1)); + + } PetApiPetFindByStatusResource::~PetApiPetFindByStatusResource() @@ -354,6 +363,8 @@ PetApiPetFindByTagsResource::PetApiPetFindByTagsResource() this->set_method_handler("GET", std::bind(&PetApiPetFindByTagsResource::GET_method_handler, this, std::placeholders::_1)); + + } PetApiPetFindByTagsResource::~PetApiPetFindByTagsResource() @@ -406,6 +417,11 @@ PetApiPetPetIdUploadImageResource::PetApiPetPetIdUploadImageResource() this->set_method_handler("POST", std::bind(&PetApiPetPetIdUploadImageResource::POST_method_handler, this, std::placeholders::_1)); + + petId = 0L; + additionalMetadata = ""; + file = ""; + } PetApiPetPetIdUploadImageResource::~PetApiPetPetIdUploadImageResource() diff --git a/samples/server/petstore/cpp-restbed/api/PetApi.h b/samples/server/petstore/cpp-restbed/api/PetApi.h index f437fbadb417..41a117a885bc 100644 --- a/samples/server/petstore/cpp-restbed/api/PetApi.h +++ b/samples/server/petstore/cpp-restbed/api/PetApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -83,7 +83,7 @@ class PetApiPetResource: public restbed::Resource std::shared_ptr const & )> handler_PUT_; - std::shared_ptr body{}; + std::shared_ptr body; }; /// @@ -130,8 +130,8 @@ class PetApiPetPetIdResource: public restbed::Resource int64_t const &, std::string const &, std::string const & )> handler_POST_; - int64_t petId{}; - std::string apiKey{}; + int64_t petId; + std::string apiKey; }; /// @@ -160,7 +160,7 @@ class PetApiPetFindByStatusResource: public restbed::Resource )> handler_GET_; - std::vector status{}; + std::vector status; }; /// @@ -189,7 +189,7 @@ class PetApiPetFindByTagsResource: public restbed::Resource )> handler_GET_; - std::vector tags{}; + std::vector tags; }; /// @@ -218,9 +218,9 @@ class PetApiPetPetIdUploadImageResource: public restbed::Resource )> handler_POST_; - int64_t petId{}; - std::string additionalMetadata{}; - std::string file{}; + int64_t petId; + std::string additionalMetadata; + std::string file; }; diff --git a/samples/server/petstore/cpp-restbed/api/StoreApi.cpp b/samples/server/petstore/cpp-restbed/api/StoreApi.cpp index aeafb01c6f2b..58cd31964df8 100644 --- a/samples/server/petstore/cpp-restbed/api/StoreApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/StoreApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -60,6 +60,9 @@ StoreApiStoreOrderOrderIdResource::StoreApiStoreOrderOrderIdResource() this->set_method_handler("GET", std::bind(&StoreApiStoreOrderOrderIdResource::GET_method_handler, this, std::placeholders::_1)); + + orderId = ""; + } StoreApiStoreOrderOrderIdResource::~StoreApiStoreOrderOrderIdResource() @@ -154,6 +157,8 @@ StoreApiStoreInventoryResource::StoreApiStoreInventoryResource() this->set_method_handler("GET", std::bind(&StoreApiStoreInventoryResource::GET_method_handler, this, std::placeholders::_1)); + + } StoreApiStoreInventoryResource::~StoreApiStoreInventoryResource() @@ -201,6 +206,9 @@ StoreApiStoreOrderResource::StoreApiStoreOrderResource() this->set_method_handler("POST", std::bind(&StoreApiStoreOrderResource::POST_method_handler, this, std::placeholders::_1)); + + body = std::make_shared(); + } StoreApiStoreOrderResource::~StoreApiStoreOrderResource() diff --git a/samples/server/petstore/cpp-restbed/api/StoreApi.h b/samples/server/petstore/cpp-restbed/api/StoreApi.h index f23bddfe3344..80769bd55d63 100644 --- a/samples/server/petstore/cpp-restbed/api/StoreApi.h +++ b/samples/server/petstore/cpp-restbed/api/StoreApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -83,7 +83,7 @@ class StoreApiStoreOrderOrderIdResource: public restbed::Resource int64_t const & )> handler_GET_; - std::string orderId{}; + std::string orderId; }; /// @@ -140,7 +140,7 @@ class StoreApiStoreOrderResource: public restbed::Resource )> handler_POST_; - std::shared_ptr body{}; + std::shared_ptr body; }; diff --git a/samples/server/petstore/cpp-restbed/api/UserApi.cpp b/samples/server/petstore/cpp-restbed/api/UserApi.cpp index 918b94ecd82f..9e0bb6d0c1db 100644 --- a/samples/server/petstore/cpp-restbed/api/UserApi.cpp +++ b/samples/server/petstore/cpp-restbed/api/UserApi.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -66,6 +66,9 @@ UserApiUserResource::UserApiUserResource() this->set_method_handler("POST", std::bind(&UserApiUserResource::POST_method_handler, this, std::placeholders::_1)); + + body = std::make_shared(); + } UserApiUserResource::~UserApiUserResource() @@ -125,6 +128,8 @@ UserApiUserCreateWithArrayResource::UserApiUserCreateWithArrayResource() this->set_method_handler("POST", std::bind(&UserApiUserCreateWithArrayResource::POST_method_handler, this, std::placeholders::_1)); + + } UserApiUserCreateWithArrayResource::~UserApiUserCreateWithArrayResource() @@ -184,6 +189,8 @@ UserApiUserCreateWithListResource::UserApiUserCreateWithListResource() this->set_method_handler("POST", std::bind(&UserApiUserCreateWithListResource::POST_method_handler, this, std::placeholders::_1)); + + } UserApiUserCreateWithListResource::~UserApiUserCreateWithListResource() @@ -249,6 +256,9 @@ UserApiUserUsernameResource::UserApiUserUsernameResource() this->set_method_handler("PUT", std::bind(&UserApiUserUsernameResource::PUT_method_handler, this, std::placeholders::_1)); + + username = ""; + } UserApiUserUsernameResource::~UserApiUserUsernameResource() @@ -388,6 +398,10 @@ UserApiUserLoginResource::UserApiUserLoginResource() this->set_method_handler("GET", std::bind(&UserApiUserLoginResource::GET_method_handler, this, std::placeholders::_1)); + + username = ""; + password = ""; + } UserApiUserLoginResource::~UserApiUserLoginResource() @@ -446,6 +460,8 @@ UserApiUserLogoutResource::UserApiUserLogoutResource() this->set_method_handler("GET", std::bind(&UserApiUserLogoutResource::GET_method_handler, this, std::placeholders::_1)); + + } UserApiUserLogoutResource::~UserApiUserLogoutResource() diff --git a/samples/server/petstore/cpp-restbed/api/UserApi.h b/samples/server/petstore/cpp-restbed/api/UserApi.h index 970bd05ee720..6fff9c23b445 100644 --- a/samples/server/petstore/cpp-restbed/api/UserApi.h +++ b/samples/server/petstore/cpp-restbed/api/UserApi.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -74,7 +74,7 @@ class UserApiUserResource: public restbed::Resource )> handler_POST_; - std::shared_ptr body{}; + std::shared_ptr body; }; /// @@ -103,7 +103,7 @@ class UserApiUserCreateWithArrayResource: public restbed::Resource )> handler_POST_; - std::vector> body{}; + std::vector> body; }; /// @@ -132,7 +132,7 @@ class UserApiUserCreateWithListResource: public restbed::Resource )> handler_POST_; - std::vector> body{}; + std::vector> body; }; /// @@ -179,7 +179,7 @@ class UserApiUserUsernameResource: public restbed::Resource std::string const &, std::shared_ptr const & )> handler_PUT_; - std::string username{}; + std::string username; }; /// @@ -208,8 +208,8 @@ class UserApiUserLoginResource: public restbed::Resource )> handler_GET_; - std::string username{}; - std::string password{}; + std::string username; + std::string password; }; /// diff --git a/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp b/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp index d1354e330475..7d9f5217bc57 100644 --- a/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp +++ b/samples/server/petstore/cpp-restbed/model/ApiResponse.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/ApiResponse.h b/samples/server/petstore/cpp-restbed/model/ApiResponse.h index 493b5f1f32eb..db8615f17d55 100644 --- a/samples/server/petstore/cpp-restbed/model/ApiResponse.h +++ b/samples/server/petstore/cpp-restbed/model/ApiResponse.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Category.cpp b/samples/server/petstore/cpp-restbed/model/Category.cpp index 7efa1e38878f..5e79804804b2 100644 --- a/samples/server/petstore/cpp-restbed/model/Category.cpp +++ b/samples/server/petstore/cpp-restbed/model/Category.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Category.h b/samples/server/petstore/cpp-restbed/model/Category.h index 1fa0c7bf2364..1d542d544679 100644 --- a/samples/server/petstore/cpp-restbed/model/Category.h +++ b/samples/server/petstore/cpp-restbed/model/Category.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Order.cpp b/samples/server/petstore/cpp-restbed/model/Order.cpp index 7aae7b9cbb6a..108a7f76103b 100644 --- a/samples/server/petstore/cpp-restbed/model/Order.cpp +++ b/samples/server/petstore/cpp-restbed/model/Order.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Order.h b/samples/server/petstore/cpp-restbed/model/Order.h index fc01d94d1cc3..3edc54e353e9 100644 --- a/samples/server/petstore/cpp-restbed/model/Order.h +++ b/samples/server/petstore/cpp-restbed/model/Order.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Pet.cpp b/samples/server/petstore/cpp-restbed/model/Pet.cpp index 5c677db19807..5c7cff352780 100644 --- a/samples/server/petstore/cpp-restbed/model/Pet.cpp +++ b/samples/server/petstore/cpp-restbed/model/Pet.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -75,12 +75,10 @@ ptree Pet::toPropertyTree() pt.add_child("photoUrls", tmp_node); tmp_node.clear(); } - // generate tree for Tags + // generate tree for vector of pointers of Tags if (!m_Tags.empty()) { for (const auto &childEntry : m_Tags) { - ptree Tags_node; - Tags_node.put("", childEntry); - tmp_node.push_back(std::make_pair("", Tags_node)); + tmp_node.push_back(std::make_pair("", childEntry->toPropertyTree())); } pt.add_child("tags", tmp_node); tmp_node.clear(); @@ -104,10 +102,11 @@ void Pet::fromPropertyTree(ptree const &pt) m_PhotoUrls.emplace_back(childTree.second.data()); } } - // push all items of Tags into member vector + // generate new Tag Object for each item and assign it to the current if (pt.get_child_optional("tags")) { for (const auto &childTree : pt.get_child("tags")) { - m_Tags.emplace_back(childTree.second.data()); + m_Tags.emplace_back(std::make_shared()); + m_Tags.back()->fromPropertyTree(childTree.second); } } setStatus(pt.get("status", "")); diff --git a/samples/server/petstore/cpp-restbed/model/Pet.h b/samples/server/petstore/cpp-restbed/model/Pet.h index 7376ebbb19c3..b5e97be03128 100644 --- a/samples/server/petstore/cpp-restbed/model/Pet.h +++ b/samples/server/petstore/cpp-restbed/model/Pet.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Tag.cpp b/samples/server/petstore/cpp-restbed/model/Tag.cpp index 0c5940f0e41d..200204322453 100644 --- a/samples/server/petstore/cpp-restbed/model/Tag.cpp +++ b/samples/server/petstore/cpp-restbed/model/Tag.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/Tag.h b/samples/server/petstore/cpp-restbed/model/Tag.h index b428d9bc3bac..27248c61a1f4 100644 --- a/samples/server/petstore/cpp-restbed/model/Tag.h +++ b/samples/server/petstore/cpp-restbed/model/Tag.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/User.cpp b/samples/server/petstore/cpp-restbed/model/User.cpp index 0ff1e77036b2..6d22aab6f8ce 100644 --- a/samples/server/petstore/cpp-restbed/model/User.cpp +++ b/samples/server/petstore/cpp-restbed/model/User.cpp @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/cpp-restbed/model/User.h b/samples/server/petstore/cpp-restbed/model/User.h index 062222195e6c..b8c807ac4e97 100644 --- a/samples/server/petstore/cpp-restbed/model/User.h +++ b/samples/server/petstore/cpp-restbed/model/User.h @@ -5,7 +5,7 @@ * The version of the OpenAPI document: 1.0.0 * * - * NOTE: This class is auto generated by OpenAPI-Generator 4.3.0-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator unset. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION b/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION index bfbf77eb7fad..0e97bd19efbf 100644 --- a/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION +++ b/samples/server/petstore/fsharp-functions/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION b/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION index bfbf77eb7fad..0e97bd19efbf 100644 --- a/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION +++ b/samples/server/petstore/fsharp-giraffe/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandler.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandler.fs index 6c908b8f8d9e..634acdf18752 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandler.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandler.fs @@ -29,8 +29,6 @@ module PetApiHandler = let serviceArgs = { bodyParams=bodyParams } : AddPetArgs let result = PetApiService.AddPet ctx serviceArgs return! (match result with - | AddPetDefaultStatusCode resolved -> - setStatusCode 200 >=> json resolved.content | AddPetStatusCode405 resolved -> setStatusCode 405 >=> text resolved.content ) next ctx @@ -131,8 +129,6 @@ module PetApiHandler = let serviceArgs = { bodyParams=bodyParams } : UpdatePetArgs let result = PetApiService.UpdatePet ctx serviceArgs return! (match result with - | UpdatePetDefaultStatusCode resolved -> - setStatusCode 200 >=> json resolved.content | UpdatePetStatusCode400 resolved -> setStatusCode 400 >=> text resolved.content | UpdatePetStatusCode404 resolved -> diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandlerParams.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandlerParams.fs index 50d343fa1756..f84ffb76b22c 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandlerParams.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/api/PetApiHandlerParams.fs @@ -14,16 +14,11 @@ module PetApiHandlerParams = //#endregion - type AddPetDefaultStatusCodeResponse = { - content:Pet; - - } - type AddPetStatusCode405Response = { content:string; } - type AddPetResult = AddPetDefaultStatusCode of AddPetDefaultStatusCodeResponse|AddPetStatusCode405 of AddPetStatusCode405Response + type AddPetResult = AddPetStatusCode405 of AddPetStatusCode405Response type AddPetArgs = { bodyParams:AddPetBodyParams @@ -135,11 +130,6 @@ module PetApiHandlerParams = //#endregion - type UpdatePetDefaultStatusCodeResponse = { - content:Pet; - - } - type UpdatePetStatusCode400Response = { content:string; @@ -154,7 +144,7 @@ module PetApiHandlerParams = content:string; } - type UpdatePetResult = UpdatePetDefaultStatusCode of UpdatePetDefaultStatusCodeResponse|UpdatePetStatusCode400 of UpdatePetStatusCode400Response|UpdatePetStatusCode404 of UpdatePetStatusCode404Response|UpdatePetStatusCode405 of UpdatePetStatusCode405Response + type UpdatePetResult = UpdatePetStatusCode400 of UpdatePetStatusCode400Response|UpdatePetStatusCode404 of UpdatePetStatusCode404Response|UpdatePetStatusCode405 of UpdatePetStatusCode405Response type UpdatePetArgs = { bodyParams:UpdatePetBodyParams diff --git a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/PetApiService.fs b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/PetApiService.fs index c7a6f3adb8b9..948ee5ce71a2 100644 --- a/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/PetApiService.fs +++ b/samples/server/petstore/fsharp-giraffe/OpenAPI/src/impl/PetApiService.fs @@ -14,10 +14,6 @@ module PetApiServiceImplementation = interface IPetApiService with member this.AddPet ctx args = - if true then - let content = "successful operation" :> obj :?> Pet // this cast is obviously wrong, and is only intended to allow generated project to compile - AddPetDefaultStatusCode { content = content } - else let content = "Invalid input" AddPetStatusCode405 { content = content } @@ -54,9 +50,6 @@ module PetApiServiceImplementation = member this.UpdatePet ctx args = if true then - let content = "successful operation" :> obj :?> Pet // this cast is obviously wrong, and is only intended to allow generated project to compile - UpdatePetDefaultStatusCode { content = content } - else if true then let content = "Invalid ID supplied" UpdatePetStatusCode400 { content = content } else if true then diff --git a/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION b/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION index bfbf77eb7fad..afa636560641 100644 --- a/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION +++ b/samples/server/petstore/graphql-nodejs-express-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION index bfbf77eb7fad..c3a2c7076fa8 100644 --- a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION +++ b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-inflector/.openapi-generator/VERSION b/samples/server/petstore/java-inflector/.openapi-generator/VERSION index bfbf77eb7fad..dde25ef08e8c 100644 --- a/samples/server/petstore/java-inflector/.openapi-generator/VERSION +++ b/samples/server/petstore/java-inflector/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 5485142beac2..f9d5285bb6e6 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -16,224 +15,44 @@ public class AdditionalPropertiesClass { - @JsonProperty("map_string") - private Map mapString = null; + @JsonProperty("map_property") + private Map mapProperty = null; - @JsonProperty("map_number") - private Map mapNumber = null; - - @JsonProperty("map_integer") - private Map mapInteger = null; - - @JsonProperty("map_boolean") - private Map mapBoolean = null; - - @JsonProperty("map_array_integer") - private Map> mapArrayInteger = null; - - @JsonProperty("map_array_anytype") - private Map> mapArrayAnytype = null; - - @JsonProperty("map_map_string") - private Map> mapMapString = null; - - @JsonProperty("map_map_anytype") - private Map> mapMapAnytype = null; - - @JsonProperty("anytype_1") - private Object anytype1; - - @JsonProperty("anytype_2") - private Object anytype2; - - @JsonProperty("anytype_3") - private Object anytype3; - - /** - **/ - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_string") - public Map getMapString() { - return mapString; - } - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - /** - **/ - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_number") - public Map getMapNumber() { - return mapNumber; - } - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - } - - /** - **/ - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_integer") - public Map getMapInteger() { - return mapInteger; - } - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - /** - **/ - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_boolean") - public Map getMapBoolean() { - return mapBoolean; - } - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - /** - **/ - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_array_integer") - public Map> getMapArrayInteger() { - return mapArrayInteger; - } - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - /** - **/ - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_array_anytype") - public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - /** - **/ - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_map_string") - public Map> getMapMapString() { - return mapMapString; - } - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - /** - **/ - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_map_anytype") - public Map> getMapMapAnytype() { - return mapMapAnytype; - } - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - /** - **/ - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("anytype_1") - public Object getAnytype1() { - return anytype1; - } - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } + @JsonProperty("map_of_map_property") + private Map> mapOfMapProperty = null; /** **/ - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; return this; } @ApiModelProperty(value = "") - @JsonProperty("anytype_2") - public Object getAnytype2() { - return anytype2; + @JsonProperty("map_property") + public Map getMapProperty() { + return mapProperty; } - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; } /** **/ - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; return this; } @ApiModelProperty(value = "") - @JsonProperty("anytype_3") - public Object getAnytype3() { - return anytype3; + @JsonProperty("map_of_map_property") + public Map> getMapOfMapProperty() { + return mapOfMapProperty; } - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; } @@ -246,22 +65,13 @@ public boolean equals(java.lang.Object o) { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(mapString, additionalPropertiesClass.mapString) && - Objects.equals(mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(anytype3, additionalPropertiesClass.anytype3); + return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); } @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapProperty, mapOfMapProperty); } @Override @@ -269,17 +79,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java index bfcf5486f248..dd9447b5ebef 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Animal.java @@ -15,7 +15,7 @@ public class Animal { @JsonProperty("className") - private String className; + private String className = null; @JsonProperty("color") private String color = "red"; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java index 5ac9b3add792..02af8353e587 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Capitalization.java @@ -13,22 +13,22 @@ public class Capitalization { @JsonProperty("smallCamel") - private String smallCamel; + private String smallCamel = null; @JsonProperty("CapitalCamel") - private String capitalCamel; + private String capitalCamel = null; @JsonProperty("small_Snake") - private String smallSnake; + private String smallSnake = null; @JsonProperty("Capital_Snake") - private String capitalSnake; + private String capitalSnake = null; @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints; + private String scAETHFlowPoints = null; @JsonProperty("ATT_NAME") - private String ATT_NAME; + private String ATT_NAME = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java index c8a9293aba98..5335d698a8b2 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Cat.java @@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; -import org.openapitools.model.CatAllOf; @@ -15,7 +14,7 @@ public class Cat extends Animal { @JsonProperty("declawed") - private Boolean declawed; + private Boolean declawed = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java index fe52381c0934..873014460b2e 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Category.java @@ -13,10 +13,10 @@ public class Category { @JsonProperty("id") - private Long id; + private Long id = null; @JsonProperty("name") - private String name = "default-name"; + private String name = null; /** **/ @@ -43,7 +43,7 @@ public Category name(String name) { } - @ApiModelProperty(required = true, value = "") + @ApiModelProperty(value = "") @JsonProperty("name") public String getName() { return name; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java index ca34fbd20177..d01849217ed0 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ClassModel.java @@ -16,7 +16,7 @@ public class ClassModel { @JsonProperty("_class") - private String propertyClass; + private String propertyClass = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java index a1838210b476..9e2392899fa4 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Client.java @@ -13,7 +13,7 @@ public class Client { @JsonProperty("client") - private String client; + private String client = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java index 9198fef58d58..3cc5ac3dad58 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Dog.java @@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; -import org.openapitools.model.DogAllOf; @@ -15,7 +14,7 @@ public class Dog extends Animal { @JsonProperty("breed") - private String breed; + private String breed = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java index 56b5ce98e147..e53b95e708fb 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumArrays.java @@ -42,12 +42,12 @@ public static JustSymbolEnum fromValue(String text) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + return null; } } @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol; + private JustSymbolEnum justSymbol = null; /** * Gets or Sets arrayEnum @@ -76,7 +76,7 @@ public static ArrayEnumEnum fromValue(String text) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + return null; } } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java index c0e2beefb8a0..04b4b96e1633 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumClass.java @@ -37,7 +37,7 @@ public static EnumClass fromValue(String text) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + return null; } } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java index 4c3d4a46380e..c3aa4764bd05 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/EnumTest.java @@ -43,12 +43,12 @@ public static EnumStringEnum fromValue(String text) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + return null; } } @JsonProperty("enum_string") - private EnumStringEnum enumString; + private EnumStringEnum enumString = null; /** * Gets or Sets enumStringRequired @@ -79,12 +79,12 @@ public static EnumStringRequiredEnum fromValue(String text) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + return null; } } @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired; + private EnumStringRequiredEnum enumStringRequired = null; /** * Gets or Sets enumInteger @@ -113,12 +113,12 @@ public static EnumIntegerEnum fromValue(String text) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + return null; } } @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger; + private EnumIntegerEnum enumInteger = null; /** * Gets or Sets enumNumber @@ -147,15 +147,15 @@ public static EnumNumberEnum fromValue(String text) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + return null; } } @JsonProperty("enum_number") - private EnumNumberEnum enumNumber; + private EnumNumberEnum enumNumber = null; @JsonProperty("outerEnum") - private OuterEnum outerEnum; + private OuterEnum outerEnum = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 2c58dcd87887..c02bc42218b7 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -15,7 +15,7 @@ public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file; + private java.io.File file = null; @JsonProperty("files") private List files = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java index c962633574c1..b755b19fda8d 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/FormatTest.java @@ -17,46 +17,43 @@ public class FormatTest { @JsonProperty("integer") - private Integer integer; + private Integer integer = null; @JsonProperty("int32") - private Integer int32; + private Integer int32 = null; @JsonProperty("int64") - private Long int64; + private Long int64 = null; @JsonProperty("number") - private BigDecimal number; + private BigDecimal number = null; @JsonProperty("float") - private Float _float; + private Float _float = null; @JsonProperty("double") - private Double _double; + private Double _double = null; @JsonProperty("string") - private String string; + private String string = null; @JsonProperty("byte") - private byte[] _byte; + private byte[] _byte = null; @JsonProperty("binary") - private File binary; + private File binary = null; @JsonProperty("date") - private Date date; + private Date date = null; @JsonProperty("dateTime") - private Date dateTime; + private Date dateTime = null; @JsonProperty("uuid") - private UUID uuid; + private UUID uuid = null; @JsonProperty("password") - private String password; - - @JsonProperty("BigDecimal") - private BigDecimal bigDecimal; + private String password = null; /** * minimum: 10 @@ -263,7 +260,7 @@ public FormatTest uuid(UUID uuid) { } - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @ApiModelProperty(value = "") @JsonProperty("uuid") public UUID getUuid() { return uuid; @@ -289,23 +286,6 @@ public void setPassword(String password) { this.password = password; } - /** - **/ - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("BigDecimal") - public BigDecimal getBigDecimal() { - return bigDecimal; - } - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - @Override public boolean equals(java.lang.Object o) { @@ -328,13 +308,12 @@ public boolean equals(java.lang.Object o) { Objects.equals(date, formatTest.date) && Objects.equals(dateTime, formatTest.dateTime) && Objects.equals(uuid, formatTest.uuid) && - Objects.equals(password, formatTest.password) && - Objects.equals(bigDecimal, formatTest.bigDecimal); + Objects.equals(password, formatTest.password); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } @Override @@ -355,7 +334,6 @@ public String toString() { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index b3c40ffb503e..7dce1117eb1c 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -13,10 +13,10 @@ public class HasOnlyReadOnly { @JsonProperty("bar") - private String bar; + private String bar = null; @JsonProperty("foo") - private String foo; + private String foo = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java index 7f22d852e3c1..2ba14f914ebe 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MapTest.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; @@ -46,7 +47,7 @@ public static InnerEnum fromValue(String text) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + return null; } } @@ -57,7 +58,7 @@ public static InnerEnum fromValue(String text) { private Map directMap = null; @JsonProperty("indirect_map") - private Map indirectMap = null; + private StringBooleanMap indirectMap = null; /** **/ @@ -112,7 +113,7 @@ public void setDirectMap(Map directMap) { /** **/ - public MapTest indirectMap(Map indirectMap) { + public MapTest indirectMap(StringBooleanMap indirectMap) { this.indirectMap = indirectMap; return this; } @@ -120,10 +121,10 @@ public MapTest indirectMap(Map indirectMap) { @ApiModelProperty(value = "") @JsonProperty("indirect_map") - public Map getIndirectMap() { + public StringBooleanMap getIndirectMap() { return indirectMap; } - public void setIndirectMap(Map indirectMap) { + public void setIndirectMap(StringBooleanMap indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 24b4ef0e1e71..1a09fa8a7f22 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -19,10 +19,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private UUID uuid; + private UUID uuid = null; @JsonProperty("dateTime") - private Date dateTime; + private Date dateTime = null; @JsonProperty("map") private Map map = null; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java index d2bb54537374..84f8223b8040 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Model200Response.java @@ -16,10 +16,10 @@ public class Model200Response { @JsonProperty("name") - private Integer name; + private Integer name = null; @JsonProperty("class") - private String propertyClass; + private String propertyClass = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java index b711cae39dd0..9e77e3f7d0d4 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -13,13 +13,13 @@ public class ModelApiResponse { @JsonProperty("code") - private Integer code; + private Integer code = null; @JsonProperty("type") - private String type; + private String type = null; @JsonProperty("message") - private String message; + private String message = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java index 990b7b9a36d4..5e768ccc566a 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ModelReturn.java @@ -16,7 +16,7 @@ public class ModelReturn { @JsonProperty("return") - private Integer _return; + private Integer _return = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java index e96e805ba3ce..5ec8687a8ba6 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Name.java @@ -16,16 +16,16 @@ public class Name { @JsonProperty("name") - private Integer name; + private Integer name = null; @JsonProperty("snake_case") - private Integer snakeCase; + private Integer snakeCase = null; @JsonProperty("property") - private String property; + private String property = null; @JsonProperty("123Number") - private Integer _123number; + private Integer _123number = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java index 8bb6fd8fe02f..24389e9446e5 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/NumberOnly.java @@ -14,7 +14,7 @@ public class NumberOnly { @JsonProperty("JustNumber") - private BigDecimal justNumber; + private BigDecimal justNumber = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java index ac70304afdaf..632b6f6e4ed6 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Order.java @@ -15,16 +15,16 @@ public class Order { @JsonProperty("id") - private Long id; + private Long id = null; @JsonProperty("petId") - private Long petId; + private Long petId = null; @JsonProperty("quantity") - private Integer quantity; + private Integer quantity = null; @JsonProperty("shipDate") - private Date shipDate; + private Date shipDate = null; /** * Order Status @@ -55,12 +55,12 @@ public static StatusEnum fromValue(String text) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + return null; } } @JsonProperty("status") - private StatusEnum status; + private StatusEnum status = null; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java index 6d46e00e23c0..cbbd53117cd3 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterComposite.java @@ -14,13 +14,13 @@ public class OuterComposite { @JsonProperty("my_number") - private BigDecimal myNumber; + private BigDecimal myNumber = null; @JsonProperty("my_string") - private String myString; + private String myString = null; @JsonProperty("my_boolean") - private Boolean myBoolean; + private Boolean myBoolean = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java index f7dc82feebdd..d46baedf6c20 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/OuterEnum.java @@ -37,7 +37,7 @@ public static OuterEnum fromValue(String text) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + return null; } } diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java index 822ca68e118e..97a03717d3c9 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Pet.java @@ -18,13 +18,13 @@ public class Pet { @JsonProperty("id") - private Long id; + private Long id = null; @JsonProperty("category") - private Category category; + private Category category = null; @JsonProperty("name") - private String name; + private String name = null; @JsonProperty("photoUrls") private List photoUrls = new ArrayList(); @@ -61,12 +61,12 @@ public static StatusEnum fromValue(String text) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); + return null; } } @JsonProperty("status") - private StatusEnum status; + private StatusEnum status = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 6c2e27d8bc3d..451402ed9bd3 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -13,10 +13,10 @@ public class ReadOnlyFirst { @JsonProperty("bar") - private String bar; + private String bar = null; @JsonProperty("baz") - private String baz; + private String baz = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java index 6582bf518848..a85a7e51fdc8 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -13,7 +13,7 @@ public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long $specialPropertyName; + private Long $specialPropertyName = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java index 24e27ce9b245..fb242eaafd8f 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/Tag.java @@ -13,10 +13,10 @@ public class Tag { @JsonProperty("id") - private Long id; + private Long id = null; @JsonProperty("name") - private String name; + private String name = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java index c1f4956c8e98..b991f07867a9 100644 --- a/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/java-inflector/src/gen/java/org/openapitools/model/User.java @@ -13,28 +13,28 @@ public class User { @JsonProperty("id") - private Long id; + private Long id = null; @JsonProperty("username") - private String username; + private String username = null; @JsonProperty("firstName") - private String firstName; + private String firstName = null; @JsonProperty("lastName") - private String lastName; + private String lastName = null; @JsonProperty("email") - private String email; + private String email = null; @JsonProperty("password") - private String password; + private String password = null; @JsonProperty("phone") - private String phone; + private String phone = null; @JsonProperty("userStatus") - private Integer userStatus; + private Integer userStatus = null; /** **/ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java index 6c23f0dfa38d..529234297d99 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/AnotherFakeController.java @@ -21,7 +21,7 @@ public class AnotherFakeController { **/ /* - public ResponseContext call123testSpecialTags(RequestContext request , Client body) { + public ResponseContext testSpecialTags(RequestContext request , Client client) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java index df32b5442dce..f3e1b163c24a 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeClassnameTestController.java @@ -21,7 +21,7 @@ public class FakeClassnameTestController { **/ /* - public ResponseContext testClassname(RequestContext request , Client body) { + public ResponseContext testClassname(RequestContext request , Client client) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java index 30c90ea5c658..e069a8c9751b 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/FakeController.java @@ -19,7 +19,6 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; -import org.openapitools.model.XmlItem; public class FakeController { @@ -29,12 +28,6 @@ public class FakeController { * Code allows you to implement logic incrementally, they are disabled. **/ - /* - public ResponseContext createXmlItem(RequestContext request , XmlItem xmlItem) { - return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); - } - */ - /* public ResponseContext fakeOuterBooleanSerialize(RequestContext request , Boolean body) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); @@ -42,7 +35,7 @@ public ResponseContext fakeOuterBooleanSerialize(RequestContext request , Boolea */ /* - public ResponseContext fakeOuterCompositeSerialize(RequestContext request , OuterComposite body) { + public ResponseContext fakeOuterCompositeSerialize(RequestContext request , OuterComposite outerComposite) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -60,19 +53,19 @@ public ResponseContext fakeOuterStringSerialize(RequestContext request , String */ /* - public ResponseContext testBodyWithFileSchema(RequestContext request , FileSchemaTestClass body) { + public ResponseContext testBodyWithFileSchema(RequestContext request , FileSchemaTestClass fileSchemaTestClass) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext testBodyWithQueryParams(RequestContext request , String query, User body) { + public ResponseContext testBodyWithQueryParams(RequestContext request , String query, User user) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext testClientModel(RequestContext request , Client body) { + public ResponseContext testClientModel(RequestContext request , Client client) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -90,13 +83,7 @@ public ResponseContext testEnumParameters(RequestContext request , List */ /* - public ResponseContext testGroupParameters(RequestContext request , Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { - return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); - } - */ - - /* - public ResponseContext testInlineAdditionalProperties(RequestContext request , Map param) { + public ResponseContext testInlineAdditionalProperties(RequestContext request , Map requestBody) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -107,12 +94,6 @@ public ResponseContext testJsonFormData(RequestContext request , String param, S } */ - /* - public ResponseContext testQueryParameterCollectionFormat(RequestContext request , List pipe, List ioutil, List http, List url, List context) { - return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); - } - */ - /* public ResponseContext uploadFileWithRequiredFile(RequestContext request , Long petId, FormDataContentDisposition fileDetail, String additionalMetadata) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java index 4475ca1323a9..cd276a634870 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/PetController.java @@ -23,7 +23,7 @@ public class PetController { **/ /* - public ResponseContext addPet(RequestContext request , Pet body) { + public ResponseContext addPet(RequestContext request , Pet pet) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -53,7 +53,7 @@ public ResponseContext getPetById(RequestContext request , Long petId) { */ /* - public ResponseContext updatePet(RequestContext request , Pet body) { + public ResponseContext updatePet(RequestContext request , Pet pet) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java index f77cc1110dd1..f67f43a380c6 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/StoreController.java @@ -40,7 +40,7 @@ public ResponseContext getOrderById(RequestContext request , Long orderId) { */ /* - public ResponseContext placeOrder(RequestContext request , Order body) { + public ResponseContext placeOrder(RequestContext request , Order order) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java index 01fd4b9873ac..21ce727c6283 100644 --- a/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java +++ b/samples/server/petstore/java-inflector/src/main/java/org/openapitools/controllers/UserController.java @@ -22,19 +22,19 @@ public class UserController { **/ /* - public ResponseContext createUser(RequestContext request , User body) { + public ResponseContext createUser(RequestContext request , User user) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext createUsersWithArrayInput(RequestContext request , List body) { + public ResponseContext createUsersWithArrayInput(RequestContext request , List user) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ /* - public ResponseContext createUsersWithListInput(RequestContext request , List body) { + public ResponseContext createUsersWithListInput(RequestContext request , List user) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ @@ -64,7 +64,7 @@ public ResponseContext logoutUser(RequestContext request ) { */ /* - public ResponseContext updateUser(RequestContext request , String username, User body) { + public ResponseContext updateUser(RequestContext request , String username, User user) { return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); } */ diff --git a/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml b/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml index 0dbcb3868c6d..277114e852d3 100644 --- a/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/java-inflector/src/main/openapi/openapi.yaml @@ -32,10 +32,7 @@ paths: description: Pet object that needs to be added to the store required: true responses: - "200": - content: {} - description: successful operation - "405": + 405: content: {} description: Invalid input security: @@ -45,7 +42,6 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json put: @@ -61,16 +57,13 @@ paths: description: Pet object that needs to be added to the store required: true responses: - "200": - content: {} - description: successful operation - "400": + 400: content: {} description: Invalid ID supplied - "404": + 404: content: {} description: Pet not found - "405": + 405: content: {} description: Validation exception security: @@ -80,7 +73,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /pet/findByStatus: @@ -104,7 +96,7 @@ paths: type: array style: form responses: - "200": + 200: content: application/xml: schema: @@ -117,7 +109,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - "400": + 400: content: {} description: Invalid status value security: @@ -131,8 +123,7 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -146,7 +137,7 @@ paths: type: array style: form responses: - "200": + 200: content: application/xml: schema: @@ -159,7 +150,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - "400": + 400: content: {} description: Invalid tag value security: @@ -186,10 +177,7 @@ paths: format: int64 type: integer responses: - "200": - content: {} - description: successful operation - "400": + 400: content: {} description: Invalid pet value security: @@ -212,7 +200,7 @@ paths: format: int64 type: integer responses: - "200": + 200: content: application/xml: schema: @@ -221,10 +209,10 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - "400": + 400: content: {} description: Invalid ID supplied - "404": + 404: content: {} description: Pet not found security: @@ -255,7 +243,7 @@ paths: description: Updated status of the pet type: string responses: - "405": + 405: content: {} description: Invalid input security: @@ -291,7 +279,7 @@ paths: format: binary type: string responses: - "200": + 200: content: application/json: schema: @@ -311,7 +299,7 @@ paths: description: Returns a map of status codes to quantities operationId: getInventory responses: - "200": + 200: content: application/json: schema: @@ -337,7 +325,7 @@ paths: description: order placed for purchasing the pet required: true responses: - "200": + 200: content: application/xml: schema: @@ -346,19 +334,17 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - "400": + 400: content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /store/order/{order_id}: delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted @@ -368,10 +354,10 @@ paths: schema: type: string responses: - "400": + 400: content: {} description: Invalid ID supplied - "404": + 404: content: {} description: Order not found summary: Delete purchase order by ID @@ -379,8 +365,7 @@ paths: - store x-accepts: application/json get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched @@ -393,7 +378,7 @@ paths: minimum: 1 type: integer responses: - "200": + 200: content: application/xml: schema: @@ -402,10 +387,10 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - "400": + 400: content: {} description: Invalid ID supplied - "404": + 404: content: {} description: Order not found summary: Find purchase order by ID @@ -430,7 +415,6 @@ paths: summary: Create user tags: - user - x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /user/createWithArray: @@ -452,7 +436,6 @@ paths: summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /user/createWithList: @@ -474,7 +457,6 @@ paths: summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /user/login: @@ -494,7 +476,7 @@ paths: schema: type: string responses: - "200": + 200: content: application/xml: schema: @@ -514,7 +496,7 @@ paths: schema: format: date-time type: string - "400": + 400: content: {} description: Invalid username/password supplied summary: Logs user into the system @@ -544,10 +526,10 @@ paths: schema: type: string responses: - "400": + 400: content: {} description: Invalid username supplied - "404": + 404: content: {} description: User not found summary: Delete user @@ -564,7 +546,7 @@ paths: schema: type: string responses: - "200": + 200: content: application/xml: schema: @@ -573,10 +555,10 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - "400": + 400: content: {} description: Invalid username supplied - "404": + 404: content: {} description: User not found summary: Get user by user name @@ -601,16 +583,15 @@ paths: description: Updated user object required: true responses: - "400": + 400: content: {} description: Invalid user supplied - "404": + 404: content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: application/json /fake_classname_test: @@ -625,7 +606,7 @@ paths: description: client model required: true responses: - "200": + 200: content: application/json: schema: @@ -636,58 +617,9 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: - type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - - description: String in group parameters - in: query - name: string_group - schema: - type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: - type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: - format: int64 - type: integer - responses: - "400": - content: {} - description: Someting wrong - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - x-accepts: application/json get: description: To test enum parameters operationId: testEnumParameters @@ -779,10 +711,10 @@ paths: - (xyz) type: string responses: - "400": + 400: content: {} description: Invalid request - "404": + 404: content: {} description: Not found summary: To test enum parameters @@ -801,7 +733,7 @@ paths: description: client model required: true responses: - "200": + 200: content: application/json: schema: @@ -810,15 +742,14 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json post: - description: |- + description: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: content: @@ -827,7 +758,6 @@ paths: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -897,19 +827,19 @@ paths: - pattern_without_delimiter required: true responses: - "400": + 400: content: {} description: Invalid username supplied - "404": + 404: content: {} description: User not found security: - http_basic_test: [] - summary: |- + summary: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake x-contentType: application/x-www-form-urlencoded @@ -926,7 +856,7 @@ paths: description: Input number as post body required: false responses: - "200": + 200: content: '*/*': schema: @@ -934,7 +864,6 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/outer/string: @@ -949,7 +878,7 @@ paths: description: Input string as post body required: false responses: - "200": + 200: content: '*/*': schema: @@ -957,7 +886,6 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/outer/boolean: @@ -972,7 +900,7 @@ paths: description: Input boolean as post body required: false responses: - "200": + 200: content: '*/*': schema: @@ -980,7 +908,6 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/outer/composite: @@ -995,7 +922,7 @@ paths: description: Input composite as post body required: false responses: - "200": + 200: content: '*/*': schema: @@ -1003,7 +930,6 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body x-contentType: '*/*' x-accepts: '*/*' /fake/jsonFormData: @@ -1025,7 +951,7 @@ paths: - param2 required: true responses: - "200": + 200: content: {} description: successful operation summary: test json serialization of form data @@ -1046,13 +972,12 @@ paths: description: request body required: true responses: - "200": + 200: content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-contentType: application/json x-accepts: application/json /fake/body-with-query-params: @@ -1071,54 +996,17 @@ paths: $ref: '#/components/schemas/User' required: true responses: - "200": + 200: content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-contentType: application/xml - x-accepts: application/json /another-fake/dummy: patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags + description: To test special tags + operationId: test_special_tags requestBody: content: application/json: @@ -1127,7 +1015,7 @@ paths: description: client model required: true responses: - "200": + 200: content: application/json: schema: @@ -1136,13 +1024,11 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: For this test, the body for this request much reference a schema named `File`. operationId: testBodyWithFileSchema requestBody: content: @@ -1151,68 +1037,13 @@ paths: $ref: '#/components/schemas/FileSchemaTestClass' required: true responses: - "200": + 200: content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json - /fake/test-query-paramters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - content: {} - description: Success - tags: - - fake - x-accepts: application/json /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile @@ -1232,15 +1063,15 @@ paths: additionalMetadata: description: Additional data to pass to server type: string - requiredFile: + file: description: file to upload format: binary type: string required: - - requiredFile + - file required: true responses: - "200": + 200: content: application/json: schema: @@ -1257,53 +1088,16 @@ paths: x-accepts: application/json components: schemas: - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order Category: example: - name: default-name + name: name id: 6 properties: id: format: int64 type: integer name: - default: default-name type: string - required: - - name type: object xml: name: Category @@ -1341,72 +1135,45 @@ components: type: object xml: name: User - Tag: - example: - name: name - id: 1 + OuterNumber: + type: number + ArrayOfNumberOnly: properties: - id: - format: int64 - type: integer - name: + ArrayNumber: + items: + type: number + type: array + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet type: string type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available + MixedPropertiesAndAdditionalPropertiesClass: properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie + uuid: + format: uuid type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold + dateTime: + format: date-time type: string - required: - - name - - photoUrls + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object type: object - xml: - name: Pet ApiResponse: example: code: 0 @@ -1421,23 +1188,6 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - xml: - name: Return Name: description: Model for testing model name same as property name properties: @@ -1450,7 +1200,7 @@ components: type: integer property: type: string - "123Number": + 123Number: readOnly: true type: integer required: @@ -1458,120 +1208,50 @@ components: type: object xml: name: Name - "200_response": - description: Model for testing model name starting with number + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + List: + example: + 123-list: 123-list properties: - name: - format: int32 - type: integer - class: + 123-list: type: string type: object - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' - Animal: - discriminator: - propertyName: className + NumberOnly: properties: - className: - type: string - color: - default: red - type: string - required: - - className + JustNumber: + type: number type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: + 200_response: + description: Model for testing model name starting with number properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: + name: format: int32 - maximum: 2E+2 - minimum: 2E+1 - type: integer - int64: - format: int64 type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 + class: type: string - BigDecimal: - format: number + type: object + xml: + name: Name + Client: + example: + client: client + properties: + client: type: string - required: - - byte - - date - - number - - password type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + breed: + type: string + type: object Enum_Test: properties: enum_string: @@ -1603,140 +1283,70 @@ components: required: - enum_string_required type: object + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order AdditionalPropertiesClass: properties: - map_string: + map_property: additionalProperties: type: string type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: + map_of_map_property: additionalProperties: additionalProperties: type: string type: object type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object type: object - List: + $special[model.name]: properties: - "123-list": - type: string + $special[property.name]: + format: int64 + type: integer type: object - Client: - example: - client: client + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words properties: - client: - type: string + return: + format: int32 + type: integer type: object + xml: + name: Return ReadOnlyFirst: properties: bar: @@ -1745,56 +1355,21 @@ components: baz: type: string type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet - type: string - type: object - MapTest: + ArrayOfArrayOfNumberOnly: properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string ArrayTest: properties: array_of_string: @@ -1815,26 +1390,77 @@ components: type: array type: array type: object - NumberOnly: + OuterComposite: + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: - JustNumber: + my_number: type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: + format_test: properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + required: + - byte + - date + - number + - password type: object EnumArrays: properties: @@ -1851,37 +1477,17 @@ components: type: string type: array type: object - OuterEnum: - enum: - - placed - - approved - - delivered + OuterString: type: string - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true + ClassModel: + description: Model for testing model with "_class" property properties: - my_number: - type: number - my_string: + _class: type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body type: object - OuterNumber: - type: number - OuterString: - type: string OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object FileSchemaTestClass: example: file: @@ -1897,269 +1503,138 @@ components: $ref: '#/components/schemas/File' type: array type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI + Animal: + discriminator: + propertyName: className properties: - sourceURI: - description: Test capitalization + className: type: string - type: object - TypeHolderDefault: - properties: - string_item: - default: what + color: + default: red type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array required: - - array_item - - bool_item - - integer_item - - number_item - - string_item + - className + type: object + StringBooleanMap: + additionalProperties: + type: boolean type: object - TypeHolderExample: + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + MapTest: properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' type: object - XmlItem: + Tag: + example: + name: name + id: 1 properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 + id: + format: int64 type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string + name: type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string + type: object + xml: + name: Tag + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + File: + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 + type: object + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: + photoUrls: items: - type: integer - xml: - namespace: http://g.com/schema + type: string type: array xml: - namespace: http://f.com/schema + name: photoUrl wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: + tags: items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g + $ref: '#/components/schemas/Tag' type: array xml: - namespace: http://f.com/schema - prefix: f + name: tag wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls type: object xml: - namespace: http://a.com/schema - prefix: pre - Dog_allOf: + name: Pet + hasOnlyReadOnly: properties: - breed: + bar: + readOnly: true type: string - Cat_allOf: - properties: - declawed: - type: boolean - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars + foo: + readOnly: true type: string + type: object securitySchemes: petstore_auth: flows: @@ -2169,6 +1644,9 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 + http_basic_test: + scheme: basic + type: http api_key: in: header name: api_key @@ -2177,6 +1655,3 @@ components: in: query name: api_key_query type: apiKey - http_basic_test: - scheme: basic - type: http diff --git a/samples/server/petstore/java-pkmst/.openapi-generator/VERSION b/samples/server/petstore/java-pkmst/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/server/petstore/java-pkmst/.openapi-generator/VERSION +++ b/samples/server/petstore/java-pkmst/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java index 5398a81085b0..460fd505765c 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java index dd16463deff0..d797135e85e8 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java index 4d1df4a55b88..052d1e0ec067 100644 --- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java +++ b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/controller/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.3-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java index 70ae62fe6d2a..508aacee714e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java @@ -475,7 +475,7 @@ public Result testQueryParameterCollectionFormat() throws Exception { if (httpArray == null) { throw new IllegalArgumentException("'http' parameter is required"); } - List httpList = OpenAPIUtils.parametersToList("ssv", httpArray); + List httpList = OpenAPIUtils.parametersToList("space", httpArray); List http = new ArrayList(); for (String curParam : httpList) { if (!curParam.isEmpty()) { diff --git a/samples/server/petstore/java-undertow/.openapi-generator/VERSION b/samples/server/petstore/java-undertow/.openapi-generator/VERSION index bfbf77eb7fad..06b5019af3f4 100644 --- a/samples/server/petstore/java-undertow/.openapi-generator/VERSION +++ b/samples/server/petstore/java-undertow/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java index 3b979d4d40a9..9d9d4b7f43b0 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java @@ -22,7 +22,7 @@ public class Pet { private Long id; - private Category category; + private Category category = null; private String name; private List photoUrls = new ArrayList(); private List tags = new ArrayList(); diff --git a/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json b/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json index 1a863721712a..9bf88937dd77 100644 --- a/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json +++ b/samples/server/petstore/java-undertow/src/main/resources/config/openapi.json @@ -1,32 +1,35 @@ { "openapi" : "3.0.1", "info" : { + "title" : "OpenAPI Petstore", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "license" : { "name" : "Apache-2.0", "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" }, - "title" : "OpenAPI Petstore", "version" : "1.0.0" }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], "tags" : [ { - "description" : "Everything about your Pets", - "name" : "pet" + "name" : "pet", + "description" : "Everything about your Pets" }, { - "description" : "Access to Petstore orders", - "name" : "store" + "name" : "store", + "description" : "Access to Petstore orders" }, { - "description" : "Operations about user", - "name" : "user" + "name" : "user", + "description" : "Operations about user" } ], "paths" : { "/pet" : { - "post" : { - "operationId" : "addPet", + "put" : { + "tags" : [ "pet" ], + "summary" : "Update an existing pet", + "operationId" : "updatePet", "requestBody" : { + "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -39,27 +42,35 @@ } } }, - "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Pet not found", + "content" : { } + }, "405" : { - "content" : { }, - "description" : "Invalid input" + "description" : "Validation exception", + "content" : { } } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "summary" : "Add a new pet to the store", - "tags" : [ "pet" ], "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" }, - "put" : { - "operationId" : "updatePet", + "post" : { + "tags" : [ "pet" ], + "summary" : "Add a new pet to the store", + "operationId" : "addPet", "requestBody" : { + "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -72,28 +83,17 @@ } } }, - "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { - "400" : { - "content" : { }, - "description" : "Invalid ID supplied" - }, - "404" : { - "content" : { }, - "description" : "Pet not found" - }, "405" : { - "content" : { }, - "description" : "Validation exception" + "description" : "Invalid input", + "content" : { } } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "summary" : "Update an existing pet", - "tags" : [ "pet" ], "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" @@ -101,160 +101,132 @@ }, "/pet/findByStatus" : { "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by status", "description" : "Multiple status values can be provided with comma separated strings", "operationId" : "findPetsByStatus", "parameters" : [ { - "description" : "Status values that need to be considered for filter", - "explode" : false, - "in" : "query", "name" : "status", + "in" : "query", + "description" : "Status values that need to be considered for filter", "required" : true, + "style" : "form", + "explode" : false, "schema" : { + "type" : "array", "items" : { + "type" : "string", "default" : "available", - "enum" : [ "available", "pending", "sold" ], - "type" : "string" - }, - "type" : "array" - }, - "style" : "form" + "enum" : [ "available", "pending", "sold" ] + } + } } ], "responses" : { "200" : { + "description" : "successful operation", "content" : { "application/xml" : { "schema" : { + "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - }, - "type" : "array" + } } }, "application/json" : { "schema" : { + "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - }, - "type" : "array" + } } } - }, - "description" : "successful operation" + } }, "400" : { - "content" : { }, - "description" : "Invalid status value" + "description" : "Invalid status value", + "content" : { } } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "summary" : "Finds Pets by status", - "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/findByTags" : { "get" : { - "deprecated" : true, + "tags" : [ "pet" ], + "summary" : "Finds Pets by tags", "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", "operationId" : "findPetsByTags", "parameters" : [ { - "description" : "Tags to filter by", - "explode" : false, - "in" : "query", "name" : "tags", + "in" : "query", + "description" : "Tags to filter by", "required" : true, + "style" : "form", + "explode" : false, "schema" : { + "type" : "array", "items" : { "type" : "string" - }, - "type" : "array" - }, - "style" : "form" + } + } } ], "responses" : { "200" : { + "description" : "successful operation", "content" : { "application/xml" : { "schema" : { + "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - }, - "type" : "array" + } } }, "application/json" : { "schema" : { + "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - }, - "type" : "array" + } } } - }, - "description" : "successful operation" + } }, "400" : { - "content" : { }, - "description" : "Invalid tag value" + "description" : "Invalid tag value", + "content" : { } } }, + "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "summary" : "Finds Pets by tags", - "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "delete" : { - "operationId" : "deletePet", - "parameters" : [ { - "in" : "header", - "name" : "api_key", - "schema" : { - "type" : "string" - } - }, { - "description" : "Pet id to delete", - "in" : "path", - "name" : "petId", - "required" : true, - "schema" : { - "format" : "int64", - "type" : "integer" - } - } ], - "responses" : { - "400" : { - "content" : { }, - "description" : "Invalid pet value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "summary" : "Deletes a pet", - "tags" : [ "pet" ], - "x-accepts" : "application/json" - }, "get" : { + "tags" : [ "pet" ], + "summary" : "Find pet by ID", "description" : "Returns a single pet", "operationId" : "getPetById", "parameters" : [ { - "description" : "ID of pet to return", - "in" : "path", "name" : "petId", + "in" : "path", + "description" : "ID of pet to return", "required" : true, "schema" : { - "format" : "int64", - "type" : "integer" + "type" : "integer", + "format" : "int64" } } ], "responses" : { "200" : { + "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -266,35 +238,34 @@ "$ref" : "#/components/schemas/Pet" } } - }, - "description" : "successful operation" + } }, "400" : { - "content" : { }, - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } }, "404" : { - "content" : { }, - "description" : "Pet not found" + "description" : "Pet not found", + "content" : { } } }, "security" : [ { "api_key" : [ ] } ], - "summary" : "Find pet by ID", - "tags" : [ "pet" ], "x-accepts" : "application/json" }, "post" : { + "tags" : [ "pet" ], + "summary" : "Updates a pet in the store with form data", "operationId" : "updatePetWithForm", "parameters" : [ { - "description" : "ID of pet that needs to be updated", - "in" : "path", "name" : "petId", + "in" : "path", + "description" : "ID of pet that needs to be updated", "required" : true, "schema" : { - "format" : "int64", - "type" : "integer" + "type" : "integer", + "format" : "int64" } } ], "requestBody" : { @@ -303,12 +274,12 @@ "schema" : { "properties" : { "name" : { - "description" : "Updated name of the pet", - "type" : "string" + "type" : "string", + "description" : "Updated name of the pet" }, "status" : { - "description" : "Updated status of the pet", - "type" : "string" + "type" : "string", + "description" : "Updated status of the pet" } } } @@ -317,30 +288,61 @@ }, "responses" : { "405" : { - "content" : { }, - "description" : "Invalid input" + "description" : "Invalid input", + "content" : { } } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "summary" : "Updates a pet in the store with form data", - "tags" : [ "pet" ], "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" + }, + "delete" : { + "tags" : [ "pet" ], + "summary" : "Deletes a pet", + "operationId" : "deletePet", + "parameters" : [ { + "name" : "api_key", + "in" : "header", + "schema" : { + "type" : "string" + } + }, { + "name" : "petId", + "in" : "path", + "description" : "Pet id to delete", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid pet value", + "content" : { } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-accepts" : "application/json" } }, "/pet/{petId}/uploadImage" : { "post" : { + "tags" : [ "pet" ], + "summary" : "uploads an image", "operationId" : "uploadFile", "parameters" : [ { - "description" : "ID of pet to update", - "in" : "path", "name" : "petId", + "in" : "path", + "description" : "ID of pet to update", "required" : true, "schema" : { - "format" : "int64", - "type" : "integer" + "type" : "integer", + "format" : "int64" } } ], "requestBody" : { @@ -349,13 +351,13 @@ "schema" : { "properties" : { "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" + "type" : "string", + "description" : "Additional data to pass to server" }, "file" : { + "type" : "string", "description" : "file to upload", - "format" : "binary", - "type" : "string" + "format" : "binary" } } } @@ -364,57 +366,58 @@ }, "responses" : { "200" : { + "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - }, - "description" : "successful operation" + } } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "summary" : "uploads an image", - "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/store/inventory" : { "get" : { + "tags" : [ "store" ], + "summary" : "Returns pet inventories by status", "description" : "Returns a map of status codes to quantities", "operationId" : "getInventory", "responses" : { "200" : { + "description" : "successful operation", "content" : { "application/json" : { "schema" : { + "type" : "object", "additionalProperties" : { - "format" : "int32", - "type" : "integer" - }, - "type" : "object" + "type" : "integer", + "format" : "int32" + } } } - }, - "description" : "successful operation" + } } }, "security" : [ { "api_key" : [ ] } ], - "summary" : "Returns pet inventories by status", - "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { + "tags" : [ "store" ], + "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { + "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -422,11 +425,11 @@ } } }, - "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { + "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -438,65 +441,39 @@ "$ref" : "#/components/schemas/Order" } } - }, - "description" : "successful operation" + } }, "400" : { - "content" : { }, - "description" : "Invalid Order" + "description" : "Invalid Order", + "content" : { } } }, - "summary" : "Place an order for a pet", - "tags" : [ "store" ], "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/store/order/{orderId}" : { - "delete" : { - "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", - "operationId" : "deleteOrder", - "parameters" : [ { - "description" : "ID of the order that needs to be deleted", - "in" : "path", - "name" : "orderId", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "content" : { }, - "description" : "Invalid ID supplied" - }, - "404" : { - "content" : { }, - "description" : "Order not found" - } - }, - "summary" : "Delete purchase order by ID", - "tags" : [ "store" ], - "x-accepts" : "application/json" - }, "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" : [ { - "description" : "ID of pet that needs to be fetched", - "in" : "path", "name" : "orderId", + "in" : "path", + "description" : "ID of pet that needs to be fetched", "required" : true, "schema" : { - "format" : "int64", "maximum" : 5, "minimum" : 1, - "type" : "integer" + "type" : "integer", + "format" : "int64" } } ], "responses" : { "200" : { + "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -508,28 +485,54 @@ "$ref" : "#/components/schemas/Order" } } - }, - "description" : "successful operation" + } }, "400" : { - "content" : { }, - "description" : "Invalid ID supplied" + "description" : "Invalid ID supplied", + "content" : { } }, "404" : { - "content" : { }, - "description" : "Order not found" + "description" : "Order not found", + "content" : { } } }, - "summary" : "Find purchase order by ID", + "x-accepts" : "application/json" + }, + "delete" : { "tags" : [ "store" ], + "summary" : "Delete purchase order by ID", + "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + "operationId" : "deleteOrder", + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of the order that needs to be deleted", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Order not found", + "content" : { } + } + }, "x-accepts" : "application/json" } }, "/user" : { "post" : { + "tags" : [ "user" ], + "summary" : "Create user", "description" : "This can only be done by the logged in user.", "operationId" : "createUser", "requestBody" : { + "description" : "Created user object", "content" : { "*/*" : { "schema" : { @@ -537,17 +540,14 @@ } } }, - "description" : "Created user object", "required" : true }, "responses" : { "default" : { - "content" : { }, - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } }, - "summary" : "Create user", - "tags" : [ "user" ], "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" @@ -555,29 +555,29 @@ }, "/user/createWithArray" : { "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", "operationId" : "createUsersWithArrayInput", "requestBody" : { + "description" : "List of user object", "content" : { "*/*" : { "schema" : { + "type" : "array", "items" : { "$ref" : "#/components/schemas/User" - }, - "type" : "array" + } } } }, - "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "content" : { }, - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } }, - "summary" : "Creates list of users with given input array", - "tags" : [ "user" ], "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" @@ -585,29 +585,29 @@ }, "/user/createWithList" : { "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", "operationId" : "createUsersWithListInput", "requestBody" : { + "description" : "List of user object", "content" : { "*/*" : { "schema" : { + "type" : "array", "items" : { "$ref" : "#/components/schemas/User" - }, - "type" : "array" + } } } }, - "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "content" : { }, - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } }, - "summary" : "Creates list of users with given input array", - "tags" : [ "user" ], "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" @@ -615,19 +615,21 @@ }, "/user/login" : { "get" : { + "tags" : [ "user" ], + "summary" : "Logs user into the system", "operationId" : "loginUser", "parameters" : [ { - "description" : "The user name for login", - "in" : "query", "name" : "username", + "in" : "query", + "description" : "The user name for login", "required" : true, "schema" : { "type" : "string" } }, { - "description" : "The password for login in clear text", - "in" : "query", "name" : "password", + "in" : "query", + "description" : "The password for login in clear text", "required" : true, "schema" : { "type" : "string" @@ -635,93 +637,67 @@ } ], "responses" : { "200" : { - "content" : { - "application/xml" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", "schema" : { - "type" : "string" + "type" : "integer", + "format" : "int32" } }, - "application/json" : { + "X-Expires-After" : { + "description" : "date in UTC when toekn expires", "schema" : { - "type" : "string" + "type" : "string", + "format" : "date-time" } } }, - "description" : "successful operation", - "headers" : { - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", + "content" : { + "application/xml" : { "schema" : { - "format" : "int32", - "type" : "integer" + "type" : "string" } }, - "X-Expires-After" : { - "description" : "date in UTC when toekn expires", + "application/json" : { "schema" : { - "format" : "date-time", "type" : "string" } } } }, "400" : { - "content" : { }, - "description" : "Invalid username/password supplied" + "description" : "Invalid username/password supplied", + "content" : { } } }, - "summary" : "Logs user into the system", - "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/logout" : { "get" : { + "tags" : [ "user" ], + "summary" : "Logs out current logged in user session", "operationId" : "logoutUser", "responses" : { "default" : { - "content" : { }, - "description" : "successful operation" + "description" : "successful operation", + "content" : { } } }, - "summary" : "Logs out current logged in user session", - "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "delete" : { - "description" : "This can only be done by the logged in user.", - "operationId" : "deleteUser", - "parameters" : [ { - "description" : "The name that needs to be deleted", - "in" : "path", - "name" : "username", - "required" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "400" : { - "content" : { }, - "description" : "Invalid username supplied" - }, - "404" : { - "content" : { }, - "description" : "User not found" - } - }, - "summary" : "Delete user", - "tags" : [ "user" ], - "x-accepts" : "application/json" - }, "get" : { + "tags" : [ "user" ], + "summary" : "Get user by user name", "operationId" : "getUserByName", "parameters" : [ { - "description" : "The name that needs to be fetched. Use user1 for testing.", - "in" : "path", "name" : "username", + "in" : "path", + "description" : "The name that needs to be fetched. Use user1 for testing.", "required" : true, "schema" : { "type" : "string" @@ -729,6 +705,7 @@ } ], "responses" : { "200" : { + "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -740,35 +717,35 @@ "$ref" : "#/components/schemas/User" } } - }, - "description" : "successful operation" + } }, "400" : { - "content" : { }, - "description" : "Invalid username supplied" + "description" : "Invalid username supplied", + "content" : { } }, "404" : { - "content" : { }, - "description" : "User not found" + "description" : "User not found", + "content" : { } } }, - "summary" : "Get user by user name", - "tags" : [ "user" ], "x-accepts" : "application/json" }, "put" : { + "tags" : [ "user" ], + "summary" : "Updated user", "description" : "This can only be done by the logged in user.", "operationId" : "updateUser", "parameters" : [ { - "description" : "name that need to be deleted", - "in" : "path", "name" : "username", + "in" : "path", + "description" : "name that need to be deleted", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { + "description" : "Updated user object", "content" : { "*/*" : { "schema" : { @@ -776,109 +753,123 @@ } } }, - "description" : "Updated user object", "required" : true }, "responses" : { "400" : { - "content" : { }, - "description" : "Invalid user supplied" + "description" : "Invalid user supplied", + "content" : { } }, "404" : { - "content" : { }, - "description" : "User not found" + "description" : "User not found", + "content" : { } } }, - "summary" : "Updated user", - "tags" : [ "user" ], "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" + }, + "delete" : { + "tags" : [ "user" ], + "summary" : "Delete user", + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be deleted", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid username supplied", + "content" : { } + }, + "404" : { + "description" : "User not found", + "content" : { } + } + }, + "x-accepts" : "application/json" } } }, "components" : { "schemas" : { "Order" : { - "description" : "An order for a pets from the pet store", - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }, + "title" : "Pet Order", + "type" : "object", "properties" : { "id" : { - "format" : "int64", - "type" : "integer" + "type" : "integer", + "format" : "int64" }, "petId" : { - "format" : "int64", - "type" : "integer" + "type" : "integer", + "format" : "int64" }, "quantity" : { - "format" : "int32", - "type" : "integer" + "type" : "integer", + "format" : "int32" }, "shipDate" : { - "format" : "date-time", - "type" : "string" + "type" : "string", + "format" : "date-time" }, "status" : { + "type" : "string", "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ], - "type" : "string" + "enum" : [ "placed", "approved", "delivered" ] }, "complete" : { - "default" : false, - "type" : "boolean" + "type" : "boolean", + "default" : false } }, - "title" : "Pet Order", - "type" : "object", + "description" : "An order for a pets from the pet store", + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, "xml" : { "name" : "Order" } }, "Category" : { - "description" : "A category for a pet", - "example" : { - "name" : "name", - "id" : 6 - }, + "title" : "Pet category", + "type" : "object", "properties" : { "id" : { - "format" : "int64", - "type" : "integer" + "type" : "integer", + "format" : "int64" }, "name" : { "type" : "string" } }, - "title" : "Pet category", - "type" : "object", + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, "xml" : { "name" : "Category" } }, "User" : { - "description" : "A User who is purchasing from the pet store", - "example" : { - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" - }, + "title" : "a User", + "type" : "object", "properties" : { "id" : { - "format" : "int64", - "type" : "integer" + "type" : "integer", + "format" : "int64" }, "username" : { "type" : "string" @@ -899,113 +890,118 @@ "type" : "string" }, "userStatus" : { + "type" : "integer", "description" : "User Status", - "format" : "int32", - "type" : "integer" + "format" : "int32" } }, - "title" : "a User", - "type" : "object", + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "xml" : { "name" : "User" } }, "Tag" : { - "description" : "A tag for a pet", - "example" : { - "name" : "name", - "id" : 1 - }, + "title" : "Pet Tag", + "type" : "object", "properties" : { "id" : { - "format" : "int64", - "type" : "integer" + "type" : "integer", + "format" : "int64" }, "name" : { "type" : "string" } }, - "title" : "Pet Tag", - "type" : "object", + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, "xml" : { "name" : "Tag" } }, "Pet" : { - "description" : "A pet for sale in the pet store", - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" - }, + "title" : "a Pet", + "required" : [ "name", "photoUrls" ], + "type" : "object", "properties" : { "id" : { - "format" : "int64", - "type" : "integer" + "type" : "integer", + "format" : "int64" }, "category" : { "$ref" : "#/components/schemas/Category" }, "name" : { - "example" : "doggie", - "type" : "string" + "type" : "string", + "example" : "doggie" }, "photoUrls" : { - "items" : { - "type" : "string" - }, "type" : "array", "xml" : { "name" : "photoUrl", "wrapped" : true + }, + "items" : { + "type" : "string" } }, "tags" : { - "items" : { - "$ref" : "#/components/schemas/Tag" - }, "type" : "array", "xml" : { "name" : "tag", "wrapped" : true + }, + "items" : { + "$ref" : "#/components/schemas/Tag" } }, "status" : { + "type" : "string", "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ], - "type" : "string" + "enum" : [ "available", "pending", "sold" ] } }, - "required" : [ "name", "photoUrls" ], - "title" : "a Pet", - "type" : "object", + "description" : "A pet for sale in the pet store", + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, "xml" : { "name" : "Pet" } }, "ApiResponse" : { - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - }, + "title" : "An uploaded response", + "type" : "object", "properties" : { "code" : { - "format" : "int32", - "type" : "integer" + "type" : "integer", + "format" : "int32" }, "type" : { "type" : "string" @@ -1014,12 +1010,17 @@ "type" : "string" } }, - "title" : "An uploaded response", - "type" : "object" + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + } } }, "securitySchemes" : { "petstore_auth" : { + "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -1028,13 +1029,12 @@ "read:pets" : "read your pets" } } - }, - "type" : "oauth2" + } }, "api_key" : { - "in" : "header", + "type" : "apiKey", "name" : "api_key", - "type" : "apiKey" + "in" : "header" } } } diff --git a/samples/server/petstore/java-vertx-web/rx/.openapi-generator/VERSION b/samples/server/petstore/java-vertx-web/rx/.openapi-generator/VERSION index bfbf77eb7fad..d168f1d8bdaa 100644 --- a/samples/server/petstore/java-vertx-web/rx/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx-web/rx/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApi.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApi.java index a54ab62fe113..e7b397dc8ff3 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApi.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApi.java @@ -12,12 +12,12 @@ import java.util.Map; public interface PetApi { - Single> addPet(Pet pet); + Single> addPet(Pet pet); Single> deletePet(Long petId,String apiKey); Single>> findPetsByStatus(List status); Single>> findPetsByTags(List tags); Single> getPetById(Long petId); - Single> updatePet(Pet pet); + Single> updatePet(Pet pet); Single> updatePetWithForm(Long petId,String name,String status); Single> uploadFile(Long petId,String additionalMetadata,FileUpload file); } diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java index 113bec1f45ec..d39237914ce8 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/api/PetApiImpl.java @@ -15,7 +15,7 @@ // Implement this class public class PetApiImpl implements PetApi { - public Single> addPet(Pet pet) { + public Single> addPet(Pet pet) { return Single.error(new ApiException("Not Implemented").setStatusCode(501)); } @@ -35,7 +35,7 @@ public Single> getPetById(Long petId) { return Single.error(new ApiException("Not Implemented").setStatusCode(501)); } - public Single> updatePet(Pet pet) { + public Single> updatePet(Pet pet) { return Single.error(new ApiException("Not Implemented").setStatusCode(501)); } diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Category.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Category.java index 992be98373dc..b880122ba95c 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Category.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Category.java @@ -7,7 +7,7 @@ /** * A category for a pet **/ -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class Category { private Long id; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject.java index 3f6b989ec374..c7a35a888b97 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class InlineObject { private String name; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject1.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject1.java index 58d654e083fd..14268dda3c53 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject1.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/InlineObject1.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.vertx.ext.web.FileUpload; -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class InlineObject1 { private String additionalMetadata; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/ModelApiResponse.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/ModelApiResponse.java index 9c7fa0e9af3f..0113640b4853 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/ModelApiResponse.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/ModelApiResponse.java @@ -7,7 +7,7 @@ /** * Describes the result of uploading an image resource **/ -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class ModelApiResponse { private Integer code; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Order.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Order.java index 24c854f5948a..f9f5906416cf 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Order.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Order.java @@ -9,7 +9,7 @@ /** * An order for a pets from the pet store **/ -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class Order { private Long id; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Pet.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Pet.java index f53e6d08e824..d4bf37886cd3 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Pet.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Pet.java @@ -12,7 +12,7 @@ /** * A pet for sale in the pet store **/ -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class Pet { private Long id; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Tag.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Tag.java index bad53e0107e7..46ee7f830ad1 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Tag.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/Tag.java @@ -7,7 +7,7 @@ /** * A tag for a pet **/ -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class Tag { private Long id; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/User.java b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/User.java index 989b3bca5568..0f9fcdfd4e87 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/User.java +++ b/samples/server/petstore/java-vertx-web/rx/src/main/java/org/openapitools/vertxweb/server/model/User.java @@ -7,7 +7,7 @@ /** * A User who is purchasing from the pet store **/ -@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class User { private Long id; diff --git a/samples/server/petstore/java-vertx-web/rx/src/main/resources/openapi.yaml b/samples/server/petstore/java-vertx-web/rx/src/main/resources/openapi.yaml index 6d8ebba598bf..c35045135928 100644 --- a/samples/server/petstore/java-vertx-web/rx/src/main/resources/openapi.yaml +++ b/samples/server/petstore/java-vertx-web/rx/src/main/resources/openapi.yaml @@ -26,16 +26,7 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - "405": + 405: description: Invalid input security: - petstore_auth: @@ -51,20 +42,11 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - "400": + 400: description: Invalid ID supplied - "404": + 404: description: Pet not found - "405": + 405: description: Validation exception security: - petstore_auth: @@ -96,7 +78,7 @@ paths: type: array style: form responses: - "200": + 200: content: application/xml: schema: @@ -109,7 +91,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - "400": + 400: description: Invalid status value security: - petstore_auth: @@ -136,7 +118,7 @@ paths: type: array style: form responses: - "200": + 200: content: application/xml: schema: @@ -149,7 +131,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - "400": + 400: description: Invalid tag value security: - petstore_auth: @@ -179,7 +161,7 @@ paths: type: integer style: simple responses: - "400": + 400: description: Invalid pet value security: - petstore_auth: @@ -203,7 +185,7 @@ paths: type: integer style: simple responses: - "200": + 200: content: application/xml: schema: @@ -212,9 +194,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: [] @@ -248,7 +230,7 @@ paths: type: string type: object responses: - "405": + 405: description: Invalid input security: - petstore_auth: @@ -287,7 +269,7 @@ paths: type: string type: object responses: - "200": + 200: content: application/json: schema: @@ -307,7 +289,7 @@ paths: description: Returns a map of status codes to quantities operationId: getInventory responses: - "200": + 200: content: application/json: schema: @@ -333,7 +315,7 @@ paths: description: order placed for purchasing the pet required: true responses: - "200": + 200: content: application/xml: schema: @@ -342,7 +324,7 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - "400": + 400: description: Invalid Order summary: Place an order for a pet tags: @@ -364,9 +346,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: @@ -389,7 +371,7 @@ paths: type: integer style: simple responses: - "200": + 200: content: application/xml: schema: @@ -398,9 +380,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: @@ -479,7 +461,7 @@ paths: type: string style: form responses: - "200": + 200: content: application/xml: schema: @@ -511,7 +493,7 @@ paths: format: date-time type: string style: simple - "400": + 400: description: Invalid username/password supplied summary: Logs user into the system tags: @@ -543,9 +525,9 @@ paths: type: string style: simple responses: - "400": + 400: description: Invalid username supplied - "404": + 404: description: User not found security: - auth_cookie: [] @@ -565,7 +547,7 @@ paths: type: string style: simple responses: - "200": + 200: content: application/xml: schema: @@ -574,9 +556,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: @@ -602,9 +584,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/server/petstore/java-vertx/async/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION index bfbf77eb7fad..afa636560641 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-test-data/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java index 4d49b7da4475..34d3f595cbdd 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/api/FakeApi.java @@ -73,7 +73,7 @@ public interface FakeApi { @POST @Path("/fake/outer/number") - @Consumes({ "text/plain" }) + @Consumes({ "application/json" }) @Produces({ "*/*" }) @ApiOperation(value = "", tags={ "fake", }) @ApiResponses(value = { @@ -121,15 +121,15 @@ public interface FakeApi { public Client testClientModel(@Valid Client 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 假端點 偽のエンドポイント 가짜 엔드 포인트 * */ @POST @Path("/fake") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }) + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 404, message = "User not found") }) @@ -182,16 +182,9 @@ public interface FakeApi { @GET @Path("/fake/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "test json serialization of form data", tags={ "fake", }) + @ApiOperation(value = "test json serialization of form data", tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void testJsonFormData(@Multipart(value = "param") String param, @Multipart(value = "param2") String param2); - - @PUT - @Path("/fake/test-query-paramters") - @ApiOperation(value = "", tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - public void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe, @QueryParam("ioutil") @NotNull List ioutil, @QueryParam("http") @NotNull List http, @QueryParam("url") @NotNull List url, @QueryParam("context") @NotNull List context); } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index f17083be06cc..8d1b429f421a 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesAnyType extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 8c0fbc0652f0..067459cbce6a 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesArray extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 6fff7947b819..c4a6acccab76 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesBoolean extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 01b883e40433..467dd334dd11 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesClass { @ApiModelProperty(value = "") @@ -52,15 +51,15 @@ public class AdditionalPropertiesClass { @ApiModelProperty(value = "") @Valid - private Object anytype1; + private Object anytype1 = null; @ApiModelProperty(value = "") @Valid - private Object anytype2; + private Object anytype2 = null; @ApiModelProperty(value = "") @Valid - private Object anytype3; + private Object anytype3 = null; /** * Get mapString * @return mapString diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 83e8a3130dc6..9791c19d3e1d 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesInteger extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 3959c6a0d73f..c98d535e07ee 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesNumber extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index efbae205e250..949eec2955cf 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesObject extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 91537d4689d3..cdc65a2c3a49 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AdditionalPropertiesString extends HashMap { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java index b0fab9fb5487..1da3838e1940 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Animal.java @@ -20,9 +20,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) - public class Animal { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java index 019440823ae2..c418106a5244 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/AnimalFarm.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class AnimalFarm extends ArrayList { @Override diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 0593a095489b..b30ac2cddbaf 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class ArrayOfArrayOfNumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index ce65055a7f20..89edc0079e7f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class ArrayOfNumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java index b8781d69cb4a..88d5c73521d8 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ArrayTest.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class ArrayTest { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java index 74fbb2eb6928..899f4b5e5d72 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Capitalization.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Capitalization { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java index 9a9a80e5c670..83b49a63e37b 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Cat.java @@ -1,7 +1,6 @@ package org.openapitools.model; import org.openapitools.model.Animal; -import org.openapitools.model.CatAllOf; import javax.validation.constraints.*; import javax.validation.Valid; @@ -16,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Cat extends Animal { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java index d210c55b9e5e..c7bfb3b253e3 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Category.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Category { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java index 7e8fb51d09fb..105ecc2e7caf 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ClassModel.java @@ -20,7 +20,6 @@ * Model for testing model with \"_class\" property */ @ApiModel(description="Model for testing model with \"_class\" property") - public class ClassModel { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java index ce2f2f0d93b1..dc7323ea4141 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Client.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Client { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java index 01b3ec86bb73..e9d8e2ba5416 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Dog.java @@ -1,7 +1,6 @@ package org.openapitools.model; import org.openapitools.model.Animal; -import org.openapitools.model.DogAllOf; import javax.validation.constraints.*; import javax.validation.Valid; @@ -16,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Dog extends Animal { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java index 42b40db73f3e..2104f50c0723 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumArrays.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class EnumArrays { @XmlType(name="JustSymbolEnum") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java index 6b1538b66a6b..a8cce324ae65 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/EnumTest.java @@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class EnumTest { @XmlType(name="EnumStringEnum") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index f337973b30f6..8d3da8aa0336 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -16,12 +16,11 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class FileSchemaTestClass { @ApiModelProperty(value = "") @Valid - private java.io.File file; + private java.io.File file = null; @ApiModelProperty(value = "") @Valid diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java index b75f5241ee78..c354e724d590 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/FormatTest.java @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class FormatTest { @ApiModelProperty(value = "") @@ -63,9 +62,6 @@ public class FormatTest { @ApiModelProperty(required = true, value = "") private String password; - - @ApiModelProperty(value = "") - private BigDecimal bigDecimal; /** * Get integer * minimum: 10 @@ -392,30 +388,6 @@ public FormatTest password(String password) { return this; } - /** - * Get bigDecimal - * @return bigDecimal - */ - @JsonProperty("BigDecimal") - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - /** - * Sets the bigDecimal property. - */ - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - /** - * Sets the bigDecimal property. - */ - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - @Override public String toString() { @@ -435,7 +407,6 @@ public String toString() { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 3c7f368696d6..e615164235c8 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class HasOnlyReadOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java index e97b3da4a870..8714ac4adadd 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MapTest.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class MapTest { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 892306b389f8..f8323b7e7667 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,7 +20,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class MixedPropertiesAndAdditionalPropertiesClass { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java index d4a36c37f370..8bda567b99b7 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Model200Response.java @@ -20,7 +20,6 @@ * Model for testing model name starting with number */ @ApiModel(description="Model for testing model name starting with number") - public class Model200Response { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java index b3f9be6ca8ef..3f24ce9a87c2 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class ModelApiResponse { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java index 2a7cb4552345..a339f3b086a2 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ModelReturn.java @@ -20,7 +20,6 @@ * Model for testing reserved words */ @ApiModel(description="Model for testing reserved words") - public class ModelReturn { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java index 341dd203a69f..e8bf282ad11f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Name.java @@ -20,7 +20,6 @@ * Model for testing model name same as property name */ @ApiModel(description="Model for testing model name same as property name") - public class Name { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java index 1204458a9b10..59b9db7ff8d5 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/NumberOnly.java @@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class NumberOnly { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java index 03954f7ba6ea..09d6b24775ad 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Order.java @@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Order { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java index 2274591cee4f..bdc1aaca2f7e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/OuterComposite.java @@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class OuterComposite { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java index 67d0d6fd7012..ea553b6b5592 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Pet.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Pet { @ApiModelProperty(value = "") @@ -26,7 +25,7 @@ public class Pet { @ApiModelProperty(value = "") @Valid - private Category category; + private Category category = null; @ApiModelProperty(example = "doggie", required = true, value = "") private String name; diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 3626bcf31a68..f265ecabd172 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class ReadOnlyFirst { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java index e072c1d8c314..97b4ab49274e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class SpecialModelName { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java index 2d07ee91d333..595b94064d3f 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/StringBooleanMap.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class StringBooleanMap extends HashMap { @Override diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java index e65e4f5cfa62..3c1cc5afe270 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/Tag.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class Tag { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 62e2db250a88..54f512a9a845 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class TypeHolderDefault { @ApiModelProperty(required = true, value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java index 1cdfe3a90478..a94ba528deb1 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class TypeHolderExample { @ApiModelProperty(example = "what", required = true, value = "") @@ -27,9 +26,6 @@ public class TypeHolderExample { @Valid private BigDecimal numberItem; - @ApiModelProperty(example = "1.234", required = true, value = "") - private Float floatItem; - @ApiModelProperty(example = "-2", required = true, value = "") private Integer integerItem; @@ -88,31 +84,6 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { return this; } - /** - * Get floatItem - * @return floatItem - */ - @JsonProperty("float_item") - @NotNull - public Float getFloatItem() { - return floatItem; - } - - /** - * Sets the floatItem property. - */ - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - /** - * Sets the floatItem property. - */ - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - /** * Get integerItem * @return integerItem @@ -204,7 +175,6 @@ public String toString() { sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java index 5005cb8b4856..232586cec731 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/User.java @@ -14,7 +14,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class User { @ApiModelProperty(value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java index 4d5b2c85b602..5f5af932236e 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/gen/java/org/openapitools/model/XmlItem.java @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; - public class XmlItem { @ApiModelProperty(example = "string", value = "") diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java index 61c4946e3682..6ebd879ad571 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java @@ -35,7 +35,7 @@ public class AnotherFakeApiServiceImpl implements AnotherFakeApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/Users/david.biesack/dev/tools/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/AnotherFakeApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 00267c75c319..2d987e5a1cd1 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -43,7 +43,7 @@ public class FakeApiServiceImpl implements FakeApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/Users/david.biesack/dev/tools/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/FakeApi"); } catch (CacheException e) { e.printStackTrace(); @@ -128,9 +128,9 @@ public Client testClientModel(Client 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 假端點 偽のエンドポイント 가짜 엔드 포인트 * */ @Override @@ -178,9 +178,4 @@ public void testJsonFormData(String param, String param2) { } - @Override - public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) { - - } - } diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java index 8f251a6af319..4440d69a1ea3 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java @@ -35,7 +35,7 @@ public class FakeClassnameTags123ApiServiceImpl implements FakeClassnameTags123A { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/Users/david.biesack/dev/tools/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/FakeClassnameTags123Api"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 96e1ca669d4e..19dbdf663104 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -38,7 +38,7 @@ public class PetApiServiceImpl implements PetApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/Users/david.biesack/dev/tools/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/PetApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java index 567d58d50550..3de4afe148ea 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java @@ -35,7 +35,7 @@ public class StoreApiServiceImpl implements StoreApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/Users/david.biesack/dev/tools/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/StoreApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 7f572ff4f820..0d97bd614bb1 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -35,7 +35,7 @@ public class UserApiServiceImpl implements UserApi { { try { File cacheFile = new File(System.getProperty("jaxrs.test.server.json", - "/Users/david.biesack/dev/tools/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); + "/home/tduperron/git/zomzog/openapi-generator/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json")); cache = JsonCache.Factory.instance.get("test-data").load(cacheFile).child("/org.openapitools.api/UserApi"); } catch (CacheException e) { e.printStackTrace(); diff --git a/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json b/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json index b21cfe16b887..e32a76dd3ff1 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json +++ b/samples/server/petstore/jaxrs-cxf-test-data/src/main/resources/test-data.json @@ -79,7 +79,7 @@ } }, "testEndpointParameters" : { - "_double" : 91.68589154730603, + "_double" : 91.68589154730602421612164906388358076583244837820529937744140625, "patternWithoutDelimiter" : "^K᫢", "_byte" : "VA==", "integer" : 79, @@ -118,13 +118,6 @@ "testJsonFormData" : { "param" : "Gfe588Q6", "param2" : "QBx28IQ" - }, - "testQueryParameterCollectionFormat" : { - "pipe" : [ "pI1PMNEN" ], - "ioutil" : [ "x0M7w" ], - "http" : [ "Zz22JqF82y8A" ], - "url" : [ "Cs9OA" ], - "context" : [ "WoE87j" ] } }, "FakeClassnameTags123Api" : { diff --git a/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json b/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json index 8f15d268abd5..f368ad41cfc0 100644 --- a/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json +++ b/samples/server/petstore/jaxrs-cxf-test-data/test-data-control.json @@ -59,23 +59,6 @@ "param" : { "testItemCount" : 1 } - }, - "testQueryParameterCollectionFormat" : { - "pipe" : { - "testItemCount" : 1 - }, - "ioutil" : { - "testItemCount" : 1 - }, - "http" : { - "testItemCount" : 1 - }, - "url" : { - "testItemCount" : 1 - }, - "context" : { - "testItemCount" : 1 - } } }, "PetApi" : { diff --git a/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION index bfbf77eb7fad..6d94c9c2e12a 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface-response/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/AnotherFakeApi.java index b9c2317cb327..d72eaf4a3932 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -24,5 +24,5 @@ public interface AnotherFakeApi { @ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", tags={ "$another-fake?" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Response call123testSpecialTags(@Valid Client body); + Response call123testSpecialTags(@Valid Client client); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java index c308bb68a1ea..fed7bbc7f69b 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeApi.java @@ -10,7 +10,6 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; -import org.openapitools.model.XmlItem; import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -27,14 +26,6 @@ @Api(description = "the fake API") public interface FakeApi { - @POST - @Path("/create_xml_item") - @Consumes({ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }) - @ApiOperation(value = "creates an XmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response createXmlItem(@Valid XmlItem xmlItem); - @POST @Path("/outer/boolean") @Produces({ "*/*" }) @@ -49,7 +40,7 @@ public interface FakeApi { @ApiOperation(value = "", notes = "Test serialization of object with outer number type", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - Response fakeOuterCompositeSerialize(@Valid OuterComposite body); + Response fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite); @POST @Path("/outer/number") @@ -73,7 +64,7 @@ public interface FakeApi { @ApiOperation(value = "", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - Response testBodyWithFileSchema(@Valid FileSchemaTestClass body); + Response testBodyWithFileSchema(@Valid FileSchemaTestClass fileSchemaTestClass); @PUT @Path("/body-with-query-params") @@ -81,7 +72,7 @@ public interface FakeApi { @ApiOperation(value = "", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid User body); + Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid User user); @PATCH @Consumes({ "application/json" }) @@ -89,11 +80,11 @@ public interface FakeApi { @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Response testClientModel(@Valid Client body); + Response testClientModel(@Valid Client client); @POST @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake", }) @ApiResponses(value = { @@ -107,13 +98,7 @@ public interface FakeApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - Response testEnumParameters(@HeaderParam("enum_header_string_array") @DefaultValue("new ArrayList()") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString); - - @DELETE - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) - Response testGroupParameters(@QueryParam("required_string_group") @NotNull @ApiParam("Required String in group parameters") Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull @ApiParam("Required Boolean in group parameters") Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull @ApiParam("Required Integer in group parameters") Long requiredInt64Group,@QueryParam("string_group") @ApiParam("String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @ApiParam("Integer in group parameters") Long int64Group); + Response testEnumParameters(@HeaderParam("enum_header_string_array") @DefaultValue("new ArrayList()") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") @ApiParam("Header parameter enum test (string)") String enumHeaderString,@QueryParam("enum_query_string_array") @DefaultValue("new ArrayList()") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString); @POST @Path("/inline-additionalProperties") @@ -121,7 +106,7 @@ public interface FakeApi { @ApiOperation(value = "test inline additionalProperties", notes = "", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response testInlineAdditionalProperties(@Valid Map param); + Response testInlineAdditionalProperties(@Valid Map requestBody); @GET @Path("/jsonFormData") @@ -131,13 +116,6 @@ public interface FakeApi { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) Response testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2); - @PUT - @Path("/test-query-paramters") - @ApiOperation(value = "", notes = "To test the collection format in query parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success", response = Void.class) }) - Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context); - @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 73e623e549e0..4e7829ee210d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -25,5 +25,5 @@ public interface FakeClassnameTestApi { }, tags={ "fake_classname_tags 123#$%^" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - Response testClassname(@Valid Client body); + Response testClassname(@Valid Client client); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java index f186a66d1a31..db4be50f07b9 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/PetApi.java @@ -28,9 +28,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - Response addPet(@Valid Pet body); + Response addPet(@Valid Pet pet); @DELETE @Path("/{petId}") @@ -41,9 +40,8 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) - Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); + Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId,@HeaderParam("api_key") String apiKey); @GET @Path("/findByStatus") @@ -57,7 +55,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid status value", response = Void.class, responseContainer = "List") }) - Response findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status); + Response findPetsByStatus(@QueryParam("status") @NotNull @DefaultValue("new ArrayList()") @ApiParam("Status values that need to be considered for filter") List status); @GET @Path("/findByTags") @@ -71,7 +69,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class, responseContainer = "List") }) - Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags); + Response findPetsByTags(@QueryParam("tags") @NotNull @DefaultValue("new ArrayList()") @ApiParam("Tags to filter by") List tags); @GET @Path("/{petId}") @@ -94,11 +92,10 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - Response updatePet(@Valid Pet body); + Response updatePet(@Valid Pet pet); @POST @Path("/{petId}") diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/StoreApi.java index 802979265c27..2712d44cc786 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/StoreApi.java @@ -53,5 +53,5 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - Response placeOrder(@Valid Order body); + Response placeOrder(@Valid Order order); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java index 7848c218f5ee..d239142bf3cb 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/api/UserApi.java @@ -22,21 +22,21 @@ public interface UserApi { @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response createUser(@Valid User body); + Response createUser(@Valid User user); @POST @Path("/createWithArray") @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response createUsersWithArrayInput(@Valid List body); + Response createUsersWithArrayInput(@Valid List user); @POST @Path("/createWithList") @ApiOperation(value = "Creates list of users with given input array", notes = "", tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - Response createUsersWithListInput(@Valid List body); + Response createUsersWithListInput(@Valid List user); @DELETE @Path("/{username}") @@ -78,5 +78,5 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User body); + Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid User user); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index c70f3d5171d5..58abe9915cb2 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -2,7 +2,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -20,203 +19,41 @@ public class AdditionalPropertiesClass implements Serializable { - private @Valid Map mapString = new HashMap(); - private @Valid Map mapNumber = new HashMap(); - private @Valid Map mapInteger = new HashMap(); - private @Valid Map mapBoolean = new HashMap(); - private @Valid Map> mapArrayInteger = new HashMap>(); - private @Valid Map> mapArrayAnytype = new HashMap>(); - private @Valid Map> mapMapString = new HashMap>(); - private @Valid Map> mapMapAnytype = new HashMap>(); - private @Valid Object anytype1; - private @Valid Object anytype2; - private @Valid Object anytype3; + private @Valid Map mapProperty = new HashMap(); + private @Valid Map> mapOfMapProperty = new HashMap>(); /** **/ - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_string") - public Map getMapString() { - return mapString; + @JsonProperty("map_property") + public Map getMapProperty() { + return mapProperty; } - public void setMapString(Map mapString) { - this.mapString = mapString; + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; } /** **/ - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_number") - public Map getMapNumber() { - return mapNumber; + @JsonProperty("map_of_map_property") + public Map> getMapOfMapProperty() { + return mapOfMapProperty; } - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - } - - /** - **/ - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_integer") - public Map getMapInteger() { - return mapInteger; - } - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - /** - **/ - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_boolean") - public Map getMapBoolean() { - return mapBoolean; - } - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - /** - **/ - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_array_integer") - public Map> getMapArrayInteger() { - return mapArrayInteger; - } - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - /** - **/ - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_array_anytype") - public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - /** - **/ - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_map_string") - public Map> getMapMapString() { - return mapMapString; - } - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - /** - **/ - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_map_anytype") - public Map> getMapMapAnytype() { - return mapMapAnytype; - } - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - /** - **/ - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("anytype_1") - public Object getAnytype1() { - return anytype1; - } - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - /** - **/ - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("anytype_2") - public Object getAnytype2() { - return anytype2; - } - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - /** - **/ - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("anytype_3") - public Object getAnytype3() { - return anytype3; - } - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; } @@ -229,22 +66,13 @@ public boolean equals(java.lang.Object o) { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); + return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); } @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapProperty, mapOfMapProperty); } @Override @@ -252,17 +80,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java index 43bfbb7fd24d..8b2e9658341d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Animal.java @@ -14,12 +14,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), -}) public class Animal implements Serializable { @@ -72,8 +66,8 @@ public boolean equals(java.lang.Object o) { return false; } Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); + return Objects.equals(className, animal.className) && + Objects.equals(color, animal.color); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index cc9abca8a2a8..43d65d72f381 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -48,7 +48,7 @@ public boolean equals(java.lang.Object o) { return false; } ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + return Objects.equals(arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 40acdceef6a3..f29bd99493ae 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -48,7 +48,7 @@ public boolean equals(java.lang.Object o) { return false; } ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + return Objects.equals(arrayNumber, arrayOfNumberOnly.arrayNumber); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java index bd3241465564..249f75701bef 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ArrayTest.java @@ -84,9 +84,9 @@ public boolean equals(java.lang.Object o) { return false; } ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + return Objects.equals(arrayOfString, arrayTest.arrayOfString) && + Objects.equals(arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(arrayArrayOfModel, arrayTest.arrayArrayOfModel); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java index 9c9d8a8f4255..5ca325b2667b 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Capitalization.java @@ -136,12 +136,12 @@ public boolean equals(java.lang.Object o) { return false; } Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + return Objects.equals(smallCamel, capitalization.smallCamel) && + Objects.equals(capitalCamel, capitalization.capitalCamel) && + Objects.equals(smallSnake, capitalization.smallSnake) && + Objects.equals(capitalSnake, capitalization.capitalSnake) && + Objects.equals(scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(ATT_NAME, capitalization.ATT_NAME); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java index 12cfde8994ab..9bfcfde280c2 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Cat.java @@ -3,7 +3,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; -import org.openapitools.model.CatAllOf; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -47,13 +46,12 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); + return Objects.equals(declawed, cat.declawed); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(declawed); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java index fa0c47ddd86d..4c665566958b 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Category.java @@ -17,7 +17,7 @@ public class Category implements Serializable { private @Valid Long id; - private @Valid String name = "default-name"; + private @Valid String name; /** **/ @@ -44,9 +44,8 @@ public Category name(String name) { } - @ApiModelProperty(required = true, value = "") + @ApiModelProperty(value = "") @JsonProperty("name") - @NotNull public String getName() { return name; } @@ -64,8 +63,8 @@ public boolean equals(java.lang.Object o) { return false; } Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); + return Objects.equals(id, category.id) && + Objects.equals(name, category.name); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java index 19e12db64933..5f7e3d649ce9 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ClassModel.java @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; - /** * Model for testing model with \"_class\" property **/ @@ -48,7 +47,7 @@ public boolean equals(java.lang.Object o) { return false; } ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); + return Objects.equals(propertyClass, classModel.propertyClass); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java index 9703ba67fc95..92b6aed4de68 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Client.java @@ -45,7 +45,7 @@ public boolean equals(java.lang.Object o) { return false; } Client client = (Client) o; - return Objects.equals(this.client, client.client); + return Objects.equals(client, client.client); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java index 685f46dcdd48..d22452d2d879 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Dog.java @@ -3,7 +3,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; -import org.openapitools.model.DogAllOf; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -47,13 +46,12 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); + return Objects.equals(breed, dog.breed); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(breed); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java index 9a422c1c5540..ea468a71fc02 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumArrays.java @@ -41,13 +41,13 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String value) { + public static JustSymbolEnum fromValue(String v) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } @@ -75,13 +75,13 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String value) { + public static ArrayEnumEnum fromValue(String v) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } @@ -131,8 +131,8 @@ public boolean equals(java.lang.Object o) { return false; } EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + return Objects.equals(justSymbol, enumArrays.justSymbol) && + Objects.equals(arrayEnum, enumArrays.arrayEnum); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumClass.java index 64c669177148..ba341ac9168c 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumClass.java @@ -31,13 +31,13 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String value) { + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(text)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java index 7dc8942410a0..d3f415601893 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/EnumTest.java @@ -40,13 +40,13 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String value) { + public static EnumStringEnum fromValue(String v) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } @@ -74,13 +74,13 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { + public static EnumStringRequiredEnum fromValue(String v) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } @@ -108,13 +108,13 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { + public static EnumIntegerEnum fromValue(String v) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } @@ -142,18 +142,18 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(Double value) { + public static EnumNumberEnum fromValue(String v) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } private @Valid EnumNumberEnum enumNumber; - private @Valid OuterEnum outerEnum; + private @Valid OuterEnum outerEnum = null; /** **/ @@ -251,11 +251,11 @@ public boolean equals(java.lang.Object o) { return false; } EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); + return Objects.equals(enumString, enumTest.enumString) && + Objects.equals(enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(enumInteger, enumTest.enumInteger) && + Objects.equals(enumNumber, enumTest.enumNumber) && + Objects.equals(outerEnum, enumTest.outerEnum); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index e97c11e0df28..0ba22995c7a2 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -18,7 +18,7 @@ public class FileSchemaTestClass implements Serializable { - private @Valid java.io.File file; + private @Valid java.io.File file = null; private @Valid List files = new ArrayList(); /** @@ -65,8 +65,8 @@ public boolean equals(java.lang.Object o) { return false; } FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); + return Objects.equals(file, fileSchemaTestClass.file) && + Objects.equals(files, fileSchemaTestClass.files); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java index 7132d9908d61..800fe24ff924 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java @@ -34,7 +34,6 @@ public class FormatTest implements Serializable { private @Valid Date dateTime; private @Valid UUID uuid; private @Valid String password; - private @Valid BigDecimal bigDecimal; /** * minimum: 10 @@ -244,7 +243,7 @@ public FormatTest uuid(UUID uuid) { } - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @ApiModelProperty(value = "") @JsonProperty("uuid") public UUID getUuid() { return uuid; @@ -271,23 +270,6 @@ public void setPassword(String password) { this.password = password; } - /** - **/ - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("BigDecimal") - public BigDecimal getBigDecimal() { - return bigDecimal; - } - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - @Override public boolean equals(java.lang.Object o) { @@ -298,25 +280,24 @@ public boolean equals(java.lang.Object o) { return false; } FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); + return Objects.equals(integer, formatTest.integer) && + Objects.equals(int32, formatTest.int32) && + Objects.equals(int64, formatTest.int64) && + Objects.equals(number, formatTest.number) && + Objects.equals(_float, formatTest._float) && + Objects.equals(_double, formatTest._double) && + Objects.equals(string, formatTest.string) && + Objects.equals(_byte, formatTest._byte) && + Objects.equals(binary, formatTest.binary) && + Objects.equals(date, formatTest.date) && + Objects.equals(dateTime, formatTest.dateTime) && + Objects.equals(uuid, formatTest.uuid) && + Objects.equals(password, formatTest.password); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } @Override @@ -337,7 +318,6 @@ public String toString() { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 76898a7831bc..03cf3ef7aaaf 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -63,8 +63,8 @@ public boolean equals(java.lang.Object o) { return false; } HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); + return Objects.equals(bar, hasOnlyReadOnly.bar) && + Objects.equals(foo, hasOnlyReadOnly.foo); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java index 059f500d097f..d0e0137e2107 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MapTest.java @@ -5,6 +5,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.openapitools.model.StringBooleanMap; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -43,19 +44,19 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String value) { + public static InnerEnum fromValue(String v) { for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } private @Valid Map mapOfEnumString = new HashMap(); private @Valid Map directMap = new HashMap(); - private @Valid Map indirectMap = new HashMap(); + private @Valid StringBooleanMap indirectMap = null; /** **/ @@ -110,7 +111,7 @@ public void setDirectMap(Map directMap) { /** **/ - public MapTest indirectMap(Map indirectMap) { + public MapTest indirectMap(StringBooleanMap indirectMap) { this.indirectMap = indirectMap; return this; } @@ -118,10 +119,10 @@ public MapTest indirectMap(Map indirectMap) { @ApiModelProperty(value = "") @JsonProperty("indirect_map") - public Map getIndirectMap() { + public StringBooleanMap getIndirectMap() { return indirectMap; } - public void setIndirectMap(Map indirectMap) { + public void setIndirectMap(StringBooleanMap indirectMap) { this.indirectMap = indirectMap; } @@ -135,10 +136,10 @@ public boolean equals(java.lang.Object o) { return false; } MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); + return Objects.equals(mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(directMap, mapTest.directMap) && + Objects.equals(indirectMap, mapTest.indirectMap); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8467e42ead18..dba6f5f403ff 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -87,9 +87,9 @@ public boolean equals(java.lang.Object o) { return false; } MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + return Objects.equals(uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(map, mixedPropertiesAndAdditionalPropertiesClass.map); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java index d330491d413e..d4122c4a2e1e 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Model200Response.java @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; - /** * Model for testing model name starting with number **/ @@ -66,8 +65,8 @@ public boolean equals(java.lang.Object o) { return false; } Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); + return Objects.equals(name, _200response.name) && + Objects.equals(propertyClass, _200response.propertyClass); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java index 3aeaa2e80a83..ab53e3693652 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -81,9 +81,9 @@ public boolean equals(java.lang.Object o) { return false; } ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); + return Objects.equals(code, _apiResponse.code) && + Objects.equals(type, _apiResponse.type) && + Objects.equals(message, _apiResponse.message); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java index b8ccb56ccd5d..90f40a248f25 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ModelReturn.java @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; - /** * Model for testing reserved words **/ @@ -48,7 +47,7 @@ public boolean equals(java.lang.Object o) { return false; } ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); + return Objects.equals(_return, _return._return); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java index 30f2f65ac65e..bab48c428e64 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Name.java @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; - /** * Model for testing model name same as property name **/ @@ -103,10 +102,10 @@ public boolean equals(java.lang.Object o) { return false; } Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); + return Objects.equals(name, name.name) && + Objects.equals(snakeCase, name.snakeCase) && + Objects.equals(property, name.property) && + Objects.equals(_123number, name._123number); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java index b5ae07a3dfb0..000db43f0918 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/NumberOnly.java @@ -46,7 +46,7 @@ public boolean equals(java.lang.Object o) { return false; } NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); + return Objects.equals(justNumber, numberOnly.justNumber); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java index 4c88bb4d6ad6..dc35e75e0111 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Order.java @@ -44,13 +44,13 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String value) { + public static StatusEnum fromValue(String v) { for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } @@ -170,12 +170,12 @@ public boolean equals(java.lang.Object o) { return false; } Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); + return Objects.equals(id, order.id) && + Objects.equals(petId, order.petId) && + Objects.equals(quantity, order.quantity) && + Objects.equals(shipDate, order.shipDate) && + Objects.equals(status, order.status) && + Objects.equals(complete, order.complete); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java index 14e7f71319ad..9ae89e7a2856 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterComposite.java @@ -82,9 +82,9 @@ public boolean equals(java.lang.Object o) { return false; } OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); + return Objects.equals(myNumber, outerComposite.myNumber) && + Objects.equals(myString, outerComposite.myString) && + Objects.equals(myBoolean, outerComposite.myBoolean); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterEnum.java index fbd86c9bdbe1..f69d482a93d9 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/OuterEnum.java @@ -31,13 +31,13 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String value) { + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(text)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + text + "'"); } } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java index 6718025e6926..6c5f3319798c 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Pet.java @@ -21,7 +21,7 @@ public class Pet implements Serializable { private @Valid Long id; - private @Valid Category category; + private @Valid Category category = null; private @Valid String name; private @Valid List photoUrls = new ArrayList(); private @Valid List tags = new ArrayList(); @@ -48,13 +48,13 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String value) { + public static StatusEnum fromValue(String v) { for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { + if (String.valueOf(b.value).equals(v)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + throw new IllegalArgumentException("Unexpected value '" + v + "'"); } } @@ -175,12 +175,12 @@ public boolean equals(java.lang.Object o) { return false; } Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); + return Objects.equals(id, pet.id) && + Objects.equals(category, pet.category) && + Objects.equals(name, pet.name) && + Objects.equals(photoUrls, pet.photoUrls) && + Objects.equals(tags, pet.tags) && + Objects.equals(status, pet.status); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 27b680b98690..031ee7cf9f12 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -63,8 +63,8 @@ public boolean equals(java.lang.Object o) { return false; } ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); + return Objects.equals(bar, readOnlyFirst.bar) && + Objects.equals(baz, readOnlyFirst.baz); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java index 9e1984faaa05..9d589d25a4b0 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -45,7 +45,7 @@ public boolean equals(java.lang.Object o) { return false; } SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + return Objects.equals($specialPropertyName, $specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java index cec2b713130a..15e81930db25 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/Tag.java @@ -63,8 +63,8 @@ public boolean equals(java.lang.Object o) { return false; } Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); + return Objects.equals(id, tag.id) && + Objects.equals(name, tag.name); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java index 2ab19c284a30..2b3123ad16b0 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/User.java @@ -172,14 +172,14 @@ public boolean equals(java.lang.Object o) { return false; } User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); + return Objects.equals(id, user.id) && + Objects.equals(username, user.username) && + Objects.equals(firstName, user.firstName) && + Objects.equals(lastName, user.lastName) && + Objects.equals(email, user.email) && + Objects.equals(password, user.password) && + Objects.equals(phone, user.phone) && + Objects.equals(userStatus, user.userStatus); } @Override diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml index f6f5c60294f7..d20a3573e5cb 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/main/openapi/openapi.yaml @@ -32,10 +32,7 @@ paths: description: Pet object that needs to be added to the store required: true responses: - "200": - content: {} - description: successful operation - "405": + 405: content: {} description: Invalid input security: @@ -45,9 +42,6 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json x-tags: - tag: pet put: @@ -63,16 +57,13 @@ paths: description: Pet object that needs to be added to the store required: true responses: - "200": - content: {} - description: successful operation - "400": + 400: content: {} description: Invalid ID supplied - "404": + 404: content: {} description: Pet not found - "405": + 405: content: {} description: Validation exception security: @@ -82,9 +73,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json x-tags: - tag: pet /pet/findByStatus: @@ -108,7 +96,7 @@ paths: type: array style: form responses: - "200": + 200: content: application/xml: schema: @@ -121,7 +109,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - "400": + 400: content: {} description: Invalid status value security: @@ -131,14 +119,12 @@ paths: summary: Finds Pets by status tags: - pet - x-accepts: application/json x-tags: - tag: pet /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -152,7 +138,7 @@ paths: type: array style: form responses: - "200": + 200: content: application/xml: schema: @@ -165,7 +151,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - "400": + 400: content: {} description: Invalid tag value security: @@ -175,7 +161,6 @@ paths: summary: Finds Pets by tags tags: - pet - x-accepts: application/json x-tags: - tag: pet /pet/{petId}: @@ -194,10 +179,7 @@ paths: format: int64 type: integer responses: - "200": - content: {} - description: successful operation - "400": + 400: content: {} description: Invalid pet value security: @@ -207,7 +189,6 @@ paths: summary: Deletes a pet tags: - pet - x-accepts: application/json x-tags: - tag: pet get: @@ -222,7 +203,7 @@ paths: format: int64 type: integer responses: - "200": + 200: content: application/xml: schema: @@ -231,10 +212,10 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - "400": + 400: content: {} description: Invalid ID supplied - "404": + 404: content: {} description: Pet not found security: @@ -242,7 +223,6 @@ paths: summary: Find pet by ID tags: - pet - x-accepts: application/json x-tags: - tag: pet post: @@ -267,7 +247,7 @@ paths: description: Updated status of the pet type: string responses: - "405": + 405: content: {} description: Invalid input security: @@ -277,8 +257,6 @@ paths: summary: Updates a pet in the store with form data tags: - pet - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json x-tags: - tag: pet /pet/{petId}/uploadImage: @@ -305,7 +283,7 @@ paths: format: binary type: string responses: - "200": + 200: content: application/json: schema: @@ -318,8 +296,6 @@ paths: summary: uploads an image tags: - pet - x-contentType: multipart/form-data - x-accepts: application/json x-tags: - tag: pet /store/inventory: @@ -327,7 +303,7 @@ paths: description: Returns a map of status codes to quantities operationId: getInventory responses: - "200": + 200: content: application/json: schema: @@ -341,7 +317,6 @@ paths: summary: Returns pet inventories by status tags: - store - x-accepts: application/json x-tags: - tag: store /store/order: @@ -355,7 +330,7 @@ paths: description: order placed for purchasing the pet required: true responses: - "200": + 200: content: application/xml: schema: @@ -364,21 +339,17 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - "400": + 400: content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json x-tags: - tag: store /store/order/{order_id}: delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted @@ -388,21 +359,19 @@ paths: schema: type: string responses: - "400": + 400: content: {} description: Invalid ID supplied - "404": + 404: content: {} description: Order not found summary: Delete purchase order by ID tags: - store - x-accepts: application/json x-tags: - tag: store get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched @@ -415,7 +384,7 @@ paths: minimum: 1 type: integer responses: - "200": + 200: content: application/xml: schema: @@ -424,16 +393,15 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - "400": + 400: content: {} description: Invalid ID supplied - "404": + 404: content: {} description: Order not found summary: Find purchase order by ID tags: - store - x-accepts: application/json x-tags: - tag: store /user: @@ -454,9 +422,6 @@ paths: summary: Create user tags: - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json x-tags: - tag: user /user/createWithArray: @@ -478,9 +443,6 @@ paths: summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json x-tags: - tag: user /user/createWithList: @@ -502,9 +464,6 @@ paths: summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json x-tags: - tag: user /user/login: @@ -524,7 +483,7 @@ paths: schema: type: string responses: - "200": + 200: content: application/xml: schema: @@ -544,13 +503,12 @@ paths: schema: format: date-time type: string - "400": + 400: content: {} description: Invalid username/password supplied summary: Logs user into the system tags: - user - x-accepts: application/json x-tags: - tag: user /user/logout: @@ -563,7 +521,6 @@ paths: summary: Logs out current logged in user session tags: - user - x-accepts: application/json x-tags: - tag: user /user/{username}: @@ -578,16 +535,15 @@ paths: schema: type: string responses: - "400": + 400: content: {} description: Invalid username supplied - "404": + 404: content: {} description: User not found summary: Delete user tags: - user - x-accepts: application/json x-tags: - tag: user get: @@ -600,7 +556,7 @@ paths: schema: type: string responses: - "200": + 200: content: application/xml: schema: @@ -609,16 +565,15 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - "400": + 400: content: {} description: Invalid username supplied - "404": + 404: content: {} description: User not found summary: Get user by user name tags: - user - x-accepts: application/json x-tags: - tag: user put: @@ -639,18 +594,15 @@ paths: description: Updated user object required: true responses: - "400": + 400: content: {} description: Invalid user supplied - "404": + 404: content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: application/json x-tags: - tag: user /fake_classname_test: @@ -665,7 +617,7 @@ paths: description: client model required: true responses: - "200": + 200: content: application/json: schema: @@ -676,62 +628,9 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json x-tags: - tag: fake_classname_tags 123#$%^ /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: - type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - - description: String in group parameters - in: query - name: string_group - schema: - type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: - type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: - format: int64 - type: integer - responses: - "400": - content: {} - description: Someting wrong - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - x-accepts: application/json - x-tags: - - tag: fake get: description: To test enum parameters operationId: testEnumParameters @@ -823,17 +722,15 @@ paths: - (xyz) type: string responses: - "400": + 400: content: {} description: Invalid request - "404": + 404: content: {} description: Not found summary: To test enum parameters tags: - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json x-tags: - tag: fake patch: @@ -847,7 +744,7 @@ paths: description: client model required: true responses: - "200": + 200: content: application/json: schema: @@ -856,17 +753,14 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json x-tags: - tag: fake post: - description: |- + description: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: content: @@ -875,7 +769,6 @@ paths: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -945,23 +838,21 @@ paths: - pattern_without_delimiter required: true responses: - "400": + 400: content: {} description: Invalid username supplied - "404": + 404: content: {} description: User not found security: - http_basic_test: [] - summary: |- + summary: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json x-tags: - tag: fake /fake/outer/number: @@ -976,7 +867,7 @@ paths: description: Input number as post body required: false responses: - "200": + 200: content: '*/*': schema: @@ -984,9 +875,6 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' x-tags: - tag: fake /fake/outer/string: @@ -1001,7 +889,7 @@ paths: description: Input string as post body required: false responses: - "200": + 200: content: '*/*': schema: @@ -1009,9 +897,6 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' x-tags: - tag: fake /fake/outer/boolean: @@ -1026,7 +911,7 @@ paths: description: Input boolean as post body required: false responses: - "200": + 200: content: '*/*': schema: @@ -1034,9 +919,6 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' x-tags: - tag: fake /fake/outer/composite: @@ -1051,7 +933,7 @@ paths: description: Input composite as post body required: false responses: - "200": + 200: content: '*/*': schema: @@ -1059,9 +941,6 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-contentType: '*/*' - x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: @@ -1083,14 +962,12 @@ paths: - param2 required: true responses: - "200": + 200: content: {} description: successful operation summary: test json serialization of form data tags: - fake - x-contentType: application/x-www-form-urlencoded - x-accepts: application/json x-tags: - tag: fake /fake/inline-additionalProperties: @@ -1106,15 +983,12 @@ paths: description: request body required: true responses: - "200": + 200: content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param - x-contentType: application/json - x-accepts: application/json x-tags: - tag: fake /fake/body-with-query-params: @@ -1133,52 +1007,11 @@ paths: $ref: '#/components/schemas/User' required: true responses: - "200": + 200: content: {} description: Success tags: - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-contentType: application/xml - x-accepts: application/json x-tags: - tag: fake /another-fake/dummy: @@ -1193,7 +1026,7 @@ paths: description: client model required: true responses: - "200": + 200: content: application/json: schema: @@ -1202,15 +1035,11 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json x-tags: - tag: $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema - named `File`. + description: For this test, the body for this request much reference a schema named `File`. operationId: testBodyWithFileSchema requestBody: content: @@ -1219,70 +1048,11 @@ paths: $ref: '#/components/schemas/FileSchemaTestClass' required: true responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-contentType: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/test-query-paramters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": + 200: content: {} description: Success tags: - fake - x-accepts: application/json x-tags: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: @@ -1312,7 +1082,7 @@ paths: - requiredFile required: true responses: - "200": + 200: content: application/json: schema: @@ -1325,59 +1095,20 @@ paths: summary: uploads an image (required) tags: - pet - x-contentType: multipart/form-data - x-accepts: application/json x-tags: - tag: pet components: schemas: - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order Category: example: - name: default-name + name: name id: 6 properties: id: format: int64 type: integer name: - default: default-name type: string - required: - - name type: object xml: name: Category @@ -1415,72 +1146,45 @@ components: type: object xml: name: User - Tag: - example: - name: name - id: 1 + OuterNumber: + type: number + ArrayOfNumberOnly: properties: - id: - format: int64 - type: integer - name: + ArrayNumber: + items: + type: number + type: array + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet type: string type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available + MixedPropertiesAndAdditionalPropertiesClass: properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie + uuid: + format: uuid type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold + dateTime: + format: date-time type: string - required: - - name - - photoUrls + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object type: object - xml: - name: Pet ApiResponse: example: code: 0 @@ -1495,23 +1199,6 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - xml: - name: Return Name: description: Model for testing model name same as property name properties: @@ -1524,7 +1211,7 @@ components: type: integer property: type: string - "123Number": + 123Number: readOnly: true type: integer required: @@ -1532,120 +1219,50 @@ components: type: object xml: name: Name - "200_response": - description: Model for testing model name starting with number + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + List: + example: + 123-list: 123-list properties: - name: - format: int32 - type: integer - class: + 123-list: type: string type: object - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' - Animal: - discriminator: - propertyName: className + NumberOnly: properties: - className: - type: string - color: - default: red - type: string - required: - - className + JustNumber: + type: number type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: + 200_response: + description: Model for testing model name starting with number properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: + name: format: int32 - maximum: 2E+2 - minimum: 2E+1 type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 + class: type: string - BigDecimal: - format: number + type: object + xml: + name: Name + Client: + example: + client: client + properties: + client: type: string - required: - - byte - - date - - number - - password type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + breed: + type: string + type: object Enum_Test: properties: enum_string: @@ -1677,140 +1294,70 @@ components: required: - enum_string_required type: object + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order AdditionalPropertiesClass: properties: - map_string: + map_property: additionalProperties: type: string type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: + map_of_map_property: additionalProperties: additionalProperties: type: string type: object type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: + $special[model.name]: properties: - "123-list": - type: string + $special[property.name]: + format: int64 + type: integer type: object - Client: - example: - client: client + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words properties: - client: - type: string + return: + format: int32 + type: integer type: object + xml: + name: Return ReadOnlyFirst: properties: bar: @@ -1819,56 +1366,21 @@ components: baz: type: string type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet - type: string - type: object - MapTest: + ArrayOfArrayOfNumberOnly: properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string ArrayTest: properties: array_of_string: @@ -1889,26 +1401,77 @@ components: type: array type: array type: object - NumberOnly: + OuterComposite: + example: + my_string: my_string + my_number: 0.80082819046101150206595775671303272247314453125 + my_boolean: true properties: - JustNumber: + my_number: type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: + format_test: properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + required: + - byte + - date + - number + - password type: object EnumArrays: properties: @@ -1925,37 +1488,17 @@ components: type: string type: array type: object - OuterEnum: - enum: - - placed - - approved - - delivered + OuterString: type: string - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true + ClassModel: + description: Model for testing model with "_class" property properties: - my_number: - type: number - my_string: + _class: type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body type: object - OuterNumber: - type: number - OuterString: - type: string OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object FileSchemaTestClass: example: file: @@ -1971,269 +1514,139 @@ components: $ref: '#/components/schemas/File' type: array type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI + Animal: + discriminator: + propertyName: className properties: - sourceURI: - description: Test capitalization + className: type: string - type: object - TypeHolderDefault: - properties: - string_item: - default: what + color: + default: red type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array required: - - array_item - - bool_item - - integer_item - - number_item - - string_item + - className + type: object + StringBooleanMap: + additionalProperties: + type: boolean type: object - TypeHolderExample: + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + MapTest: properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' type: object - XmlItem: + Tag: + example: + name: name + id: 1 properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 + id: + format: int64 type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string + name: type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string + type: object + xml: + name: Tag + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 + type: object + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: + photoUrls: items: - type: integer - xml: - namespace: http://g.com/schema + type: string type: array xml: - namespace: http://f.com/schema + name: photoUrl wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: + tags: items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g + $ref: '#/components/schemas/Tag' type: array xml: - namespace: http://f.com/schema - prefix: f + name: tag wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls type: object xml: - namespace: http://a.com/schema - prefix: pre - Dog_allOf: + name: Pet + hasOnlyReadOnly: properties: - breed: + bar: + readOnly: true type: string - Cat_allOf: - properties: - declawed: - type: boolean - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars + foo: + readOnly: true type: string + type: object securitySchemes: petstore_auth: flows: @@ -2243,6 +1656,9 @@ components: write:pets: modify pets in your account read:pets: read your pets type: oauth2 + http_basic_test: + scheme: basic + type: http api_key: in: header name: api_key @@ -2251,6 +1667,3 @@ components: in: query name: api_key_query type: apiKey - http_basic_test: - scheme: basic - type: http diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION index bfbf77eb7fad..58592f031f65 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-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/build.gradle.kts b/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts index 49fe9400f70d..26f4601e5705 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile buildscript { repositories { jcenter() - maven { url = uri("https://repo1.maven.org/maven2") } + mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.0.M3") @@ -15,7 +15,7 @@ version = "1.0.0" repositories { jcenter() - maven { url = uri("https://repo1.maven.org/maven2") } + mavenCentral() } tasks.withType { @@ -48,7 +48,7 @@ dependencies { } repositories { - maven { url = uri("https://repo1.maven.org/maven2") } + mavenCentral() maven { url = uri("https://repo.spring.io/snapshot") } maven { url = uri("https://repo.spring.io/milestone") } } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/Exceptions.kt index 44190af7a019..4d8400902aa9 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/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-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt index bc0b66d8aba2..74e95802723e 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt @@ -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") var id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") var id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") var name: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") var name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index a73c2bacacef..a121d4abe1d1 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -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") var code: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") var code: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("type") var type: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") var type: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("message") var message: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") var message: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt index 474fd5a82b2d..5ed9ea534974 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt @@ -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") var id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") var id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("petId") var petId: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") var petId: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("quantity") var quantity: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") var quantity: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("shipDate") var shipDate: java.time.OffsetDateTime? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") var shipDate: java.time.OffsetDateTime? = null, - @ApiModelProperty(example = "null", value = "Order Status") - @JsonProperty("status") var status: Order.Status? = null, + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") var status: Order.Status? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("complete") var complete: kotlin.Boolean? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") var complete: kotlin.Boolean? = null ) { /** 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 7386590e96cf..5868cb23e3ff 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 @@ -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") var name: kotlin.String, + @get:NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") var name: kotlin.String, - @get:NotNull - @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("photoUrls") var photoUrls: kotlin.collections.List, + @get:NotNull + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") var photoUrls: kotlin.collections.List, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") var id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") var id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("category") var category: Category? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") var category: Category? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") var tags: kotlin.collections.List? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") var tags: kotlin.collections.List? = null, - @ApiModelProperty(example = "null", value = "pet status in the store") - @JsonProperty("status") var status: Pet.Status? = null + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") var status: Pet.Status? = null ) { /** diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt index ffb1ee025666..3997d00edbef 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt @@ -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") var id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") var id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") var name: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") var name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt index f9e666336daf..011d28b1cdb8 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt @@ -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") var id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") var id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("username") var username: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") var username: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("firstName") var firstName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") var firstName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("lastName") var lastName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") var lastName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("email") var email: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") var email: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("password") var password: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") var password: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("phone") var phone: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") var phone: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "User Status") - @JsonProperty("userStatus") var userStatus: kotlin.Int? = null + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") var userStatus: kotlin.Int? = null ) { } diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION index bfbf77eb7fad..d168f1d8bdaa 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt index e80d49fc3f5f..b96a3dde895e 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Pet.kt @@ -20,10 +20,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.annotation.JsonInclude /** * A pet for sale in the pet store - * @param name - * @param photoUrls * @param id * @param category + * @param name + * @param photoUrls * @param tags * @param status pet status in the store */ diff --git a/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION b/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION index bfbf77eb7fad..f9f7450d1359 100644 --- a/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION +++ b/samples/server/petstore/nancyfx-async/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/.openapi-generator/VERSION b/samples/server/petstore/nancyfx/.openapi-generator/VERSION index bfbf77eb7fad..f9f7450d1359 100644 --- a/samples/server/petstore/nancyfx/.openapi-generator/VERSION +++ b/samples/server/petstore/nancyfx/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +2.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs index b10ee5765733..db083b73bdc7 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools._v2.Models +namespace Org.OpenAPITools.v2.Models { /// /// Describes the result of uploading an image resource diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs index 23f20131922d..1bfb30abb752 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Category.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools._v2.Models +namespace Org.OpenAPITools.v2.Models { /// /// A category for a pet diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs index cc5625e044a7..7bdec1016958 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Order.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools._v2.Models +namespace Org.OpenAPITools.v2.Models { /// /// An order for a pets from the pet store @@ -30,7 +30,7 @@ public sealed class Order: IEquatable /// /// ShipDate /// - public DateTime? ShipDate { get; private set; } + public ZonedDateTime? ShipDate { get; private set; } /// /// Order Status @@ -52,7 +52,7 @@ public Order() { } - private Order(long? Id, long? PetId, int? Quantity, DateTime? ShipDate, StatusEnum? Status, bool? Complete) + private Order(long? Id, long? PetId, int? Quantity, ZonedDateTime? ShipDate, StatusEnum? Status, bool? Complete) { this.Id = Id; @@ -144,7 +144,7 @@ public sealed class OrderBuilder private long? _Id; private long? _PetId; private int? _Quantity; - private DateTime? _ShipDate; + private ZonedDateTime? _ShipDate; private StatusEnum? _Status; private bool? _Complete; @@ -192,7 +192,7 @@ public OrderBuilder Quantity(int? value) /// Sets value for Order.ShipDate property. /// /// ShipDate - public OrderBuilder ShipDate(DateTime? value) + public OrderBuilder ShipDate(ZonedDateTime? value) { _ShipDate = value; return this; diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs index 7f33c53c9081..a3f02e090883 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Pet.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools._v2.Models +namespace Org.OpenAPITools.v2.Models { /// /// A pet for sale in the pet store diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs index 4fb84eef765a..7ce321d25114 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/Tag.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools._v2.Models +namespace Org.OpenAPITools.v2.Models { /// /// A tag for a pet diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs index f4307685294c..04d33ca07f77 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Models/User.cs @@ -5,7 +5,7 @@ using Sharpility.Extensions; using NodaTime; -namespace Org.OpenAPITools._v2.Models +namespace Org.OpenAPITools.v2.Models { /// /// A User who is purchasing from the pet store diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs index 12233957857c..9cdfe6b814e6 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/PetModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools._v2.Models; -using Org.OpenAPITools._v2.Utils; +using Org.OpenAPITools.v2.Models; +using Org.OpenAPITools.v2.Utils; using NodaTime; -namespace Org.OpenAPITools._v2.Modules +namespace Org.OpenAPITools.v2.Modules { /// /// Status values that need to be considered for filter @@ -33,10 +33,10 @@ public PetModule(PetService service) : base("/v2") { Post["/pet"] = parameters => { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'AddPet'"); + var pet = this.Bind(); + Preconditions.IsNotNull(pet, "Required parameter: 'pet' is missing at 'AddPet'"); - service.AddPet(Context, body); + service.AddPet(Context, pet); return new Response { ContentType = ""}; }; @@ -76,10 +76,10 @@ public PetModule(PetService service) : base("/v2") Put["/pet"] = parameters => { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdatePet'"); + var pet = this.Bind(); + Preconditions.IsNotNull(pet, "Required parameter: 'pet' is missing at 'UpdatePet'"); - service.UpdatePet(Context, body); + service.UpdatePet(Context, pet); return new Response { ContentType = ""}; }; @@ -115,9 +115,9 @@ public interface PetService /// /// /// Context of request - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet(NancyContext context, Pet body); + void AddPet(NancyContext context, Pet pet); /// /// @@ -156,9 +156,9 @@ public interface PetService /// /// /// Context of request - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet(NancyContext context, Pet body); + void UpdatePet(NancyContext context, Pet pet); /// /// @@ -186,9 +186,9 @@ public interface PetService /// public abstract class AbstractPetService: PetService { - public virtual void AddPet(NancyContext context, Pet body) + public virtual void AddPet(NancyContext context, Pet pet) { - AddPet(body); + AddPet(pet); } public virtual void DeletePet(NancyContext context, long? petId, string apiKey) @@ -211,9 +211,9 @@ public virtual Pet GetPetById(NancyContext context, long? petId) return GetPetById(petId); } - public virtual void UpdatePet(NancyContext context, Pet body) + public virtual void UpdatePet(NancyContext context, Pet pet) { - UpdatePet(body); + UpdatePet(pet); } public virtual void UpdatePetWithForm(NancyContext context, long? petId, string name, string status) @@ -226,7 +226,7 @@ public virtual ApiResponse UploadFile(NancyContext context, long? petId, string return UploadFile(petId, additionalMetadata, file); } - protected abstract void AddPet(Pet body); + protected abstract void AddPet(Pet pet); protected abstract void DeletePet(long? petId, string apiKey); @@ -236,7 +236,7 @@ public virtual ApiResponse UploadFile(NancyContext context, long? petId, string protected abstract Pet GetPetById(long? petId); - protected abstract void UpdatePet(Pet body); + protected abstract void UpdatePet(Pet pet); protected abstract void UpdatePetWithForm(long? petId, string name, string status); diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs index 0c75b02fd9ae..be42a7b8b520 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/StoreModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools._v2.Models; -using Org.OpenAPITools._v2.Utils; +using Org.OpenAPITools.v2.Models; +using Org.OpenAPITools.v2.Utils; using NodaTime; -namespace Org.OpenAPITools._v2.Modules +namespace Org.OpenAPITools.v2.Modules { /// @@ -46,10 +46,10 @@ public StoreModule(StoreService service) : base("/v2") Post["/store/order"] = parameters => { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'PlaceOrder'"); + var order = this.Bind(); + Preconditions.IsNotNull(order, "Required parameter: 'order' is missing at 'PlaceOrder'"); - return service.PlaceOrder(Context, body); + return service.PlaceOrder(Context, order); }; } } @@ -86,9 +86,9 @@ public interface StoreService /// /// /// Context of request - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder(NancyContext context, Order body); + Order PlaceOrder(NancyContext context, Order order); } /// @@ -111,9 +111,9 @@ public virtual Order GetOrderById(NancyContext context, long? orderId) return GetOrderById(orderId); } - public virtual Order PlaceOrder(NancyContext context, Order body) + public virtual Order PlaceOrder(NancyContext context, Order order) { - return PlaceOrder(body); + return PlaceOrder(order); } protected abstract void DeleteOrder(string orderId); @@ -122,7 +122,7 @@ public virtual Order PlaceOrder(NancyContext context, Order body) protected abstract Order GetOrderById(long? orderId); - protected abstract Order PlaceOrder(Order body); + protected abstract Order PlaceOrder(Order order); } } diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs index cc268b9a2c54..c35bc62dae10 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Modules/UserModule.cs @@ -3,11 +3,11 @@ using Nancy.ModelBinding; using System.Collections.Generic; using Sharpility.Base; -using Org.OpenAPITools._v2.Models; -using Org.OpenAPITools._v2.Utils; +using Org.OpenAPITools.v2.Models; +using Org.OpenAPITools.v2.Utils; using NodaTime; -namespace Org.OpenAPITools._v2.Modules +namespace Org.OpenAPITools.v2.Modules { /// @@ -23,28 +23,28 @@ public UserModule(UserService service) : base("/v2") { Post["/user"] = parameters => { - var body = this.Bind(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUser'"); + var user = this.Bind(); + Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUser'"); - service.CreateUser(Context, body); + service.CreateUser(Context, user); return new Response { ContentType = ""}; }; Post["/user/createWithArray"] = parameters => { - var body = this.Bind>(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithArrayInput'"); + var user = this.Bind>(); + Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUsersWithArrayInput'"); - service.CreateUsersWithArrayInput(Context, body); + service.CreateUsersWithArrayInput(Context, user); return new Response { ContentType = ""}; }; Post["/user/createWithList"] = parameters => { - var body = this.Bind>(); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'CreateUsersWithListInput'"); + var user = this.Bind>(); + Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'CreateUsersWithListInput'"); - service.CreateUsersWithListInput(Context, body); + service.CreateUsersWithListInput(Context, user); return new Response { ContentType = ""}; }; @@ -86,12 +86,12 @@ public UserModule(UserService service) : base("/v2") Put["/user/{username}"] = parameters => { var username = Parameters.ValueOf(parameters, Context.Request, "username", ParameterType.Path); - var body = this.Bind(); + var user = this.Bind(); Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'UpdateUser'"); - Preconditions.IsNotNull(body, "Required parameter: 'body' is missing at 'UpdateUser'"); + Preconditions.IsNotNull(user, "Required parameter: 'user' is missing at 'UpdateUser'"); - service.UpdateUser(Context, username, body); + service.UpdateUser(Context, username, user); return new Response { ContentType = ""}; }; } @@ -106,25 +106,25 @@ public interface UserService /// This can only be done by the logged in user. /// /// Context of request - /// Created user object + /// Created user object /// - void CreateUser(NancyContext context, User body); + void CreateUser(NancyContext context, User user); /// /// /// /// Context of request - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput(NancyContext context, List body); + void CreateUsersWithArrayInput(NancyContext context, List user); /// /// /// /// Context of request - /// List of user object + /// List of user object /// - void CreateUsersWithListInput(NancyContext context, List body); + void CreateUsersWithListInput(NancyContext context, List user); /// /// This can only be done by the logged in user. @@ -163,9 +163,9 @@ public interface UserService /// /// Context of request /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser(NancyContext context, string username, User body); + void UpdateUser(NancyContext context, string username, User user); } /// @@ -173,19 +173,19 @@ public interface UserService /// public abstract class AbstractUserService: UserService { - public virtual void CreateUser(NancyContext context, User body) + public virtual void CreateUser(NancyContext context, User user) { - CreateUser(body); + CreateUser(user); } - public virtual void CreateUsersWithArrayInput(NancyContext context, List body) + public virtual void CreateUsersWithArrayInput(NancyContext context, List user) { - CreateUsersWithArrayInput(body); + CreateUsersWithArrayInput(user); } - public virtual void CreateUsersWithListInput(NancyContext context, List body) + public virtual void CreateUsersWithListInput(NancyContext context, List user) { - CreateUsersWithListInput(body); + CreateUsersWithListInput(user); } public virtual void DeleteUser(NancyContext context, string username) @@ -208,16 +208,16 @@ public virtual void LogoutUser(NancyContext context) LogoutUser(); } - public virtual void UpdateUser(NancyContext context, string username, User body) + public virtual void UpdateUser(NancyContext context, string username, User user) { - UpdateUser(username, body); + UpdateUser(username, user); } - protected abstract void CreateUser(User body); + protected abstract void CreateUser(User user); - protected abstract void CreateUsersWithArrayInput(List body); + protected abstract void CreateUsersWithArrayInput(List user); - protected abstract void CreateUsersWithListInput(List body); + protected abstract void CreateUsersWithListInput(List user); protected abstract void DeleteUser(string username); @@ -227,7 +227,7 @@ public virtual void UpdateUser(NancyContext context, string username, User body) protected abstract void LogoutUser(); - protected abstract void UpdateUser(string username, User body); + protected abstract void UpdateUser(string username, User user); } } diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj index b26666605cd3..04b710b25cbd 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -6,7 +6,7 @@ {768B8DC6-54EE-4D40-9B20-7857E1D742A4} Library Properties - Org.OpenAPITools._v2 + Org.OpenAPITools.v2 Org.OpenAPITools v4.5 512 diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs index dd90cbf5133d..9e7cfd8a8570 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/LocalDateConverter.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; -namespace Org.OpenAPITools._v2.Utils +namespace Org.OpenAPITools.v2.Utils { /// /// (De)serializes a to a string using diff --git a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs index 847527a2dbb7..9bc5408abfea 100644 --- a/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs +++ b/samples/server/petstore/nancyfx/src/Org.OpenAPITools/Utils/Parameters.cs @@ -9,7 +9,7 @@ using Sharpility.Extensions; using Sharpility.Util; -namespace Org.OpenAPITools._v2.Utils +namespace Org.OpenAPITools.v2.Utils { internal static class Parameters { diff --git a/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION b/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION index bfbf77eb7fad..83a328a9227e 100644 --- a/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION +++ b/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nodejs-express-server/api/openapi.yaml b/samples/server/petstore/nodejs-express-server/api/openapi.yaml index 1441d5d2f6e6..ab13ab57cf5a 100644 --- a/samples/server/petstore/nodejs-express-server/api/openapi.yaml +++ b/samples/server/petstore/nodejs-express-server/api/openapi.yaml @@ -31,7 +31,7 @@ paths: description: Pet object that needs to be added to the store required: true responses: - "405": + 405: content: {} description: Invalid input security: @@ -57,13 +57,13 @@ paths: description: Pet object that needs to be added to the store required: true responses: - "400": + 400: content: {} description: Invalid ID supplied - "404": + 404: content: {} description: Pet not found - "405": + 405: content: {} description: Validation exception security: @@ -97,7 +97,7 @@ paths: type: array style: form responses: - "200": + 200: content: application/xml: schema: @@ -110,7 +110,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - "400": + 400: content: {} description: Invalid status value security: @@ -140,7 +140,7 @@ paths: type: array style: form responses: - "200": + 200: content: application/xml: schema: @@ -153,7 +153,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - "400": + 400: content: {} description: Invalid tag value security: @@ -181,7 +181,7 @@ paths: format: int64 type: integer responses: - "400": + 400: content: {} description: Invalid pet value security: @@ -205,7 +205,7 @@ paths: format: int64 type: integer responses: - "200": + 200: content: application/xml: schema: @@ -214,10 +214,10 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - "400": + 400: content: {} description: Invalid ID supplied - "404": + 404: content: {} description: Pet not found security: @@ -249,7 +249,7 @@ paths: description: Updated status of the pet type: string responses: - "405": + 405: content: {} description: Invalid input security: @@ -285,7 +285,7 @@ paths: format: binary type: string responses: - "200": + 200: content: application/json: schema: @@ -305,7 +305,7 @@ paths: description: Returns a map of status codes to quantities operationId: getInventory responses: - "200": + 200: content: application/json: schema: @@ -332,7 +332,7 @@ paths: description: order placed for purchasing the pet required: true responses: - "200": + 200: content: application/xml: schema: @@ -341,7 +341,7 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - "400": + 400: content: {} description: Invalid Order summary: Place an order for a pet @@ -363,10 +363,10 @@ paths: schema: type: string responses: - "400": + 400: content: {} description: Invalid ID supplied - "404": + 404: content: {} description: Order not found summary: Delete purchase order by ID @@ -389,7 +389,7 @@ paths: minimum: 1 type: integer responses: - "200": + 200: content: application/xml: schema: @@ -398,10 +398,10 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - "400": + 400: content: {} description: Invalid ID supplied - "404": + 404: content: {} description: Order not found summary: Find purchase order by ID @@ -491,7 +491,7 @@ paths: schema: type: string responses: - "200": + 200: content: application/xml: schema: @@ -511,7 +511,7 @@ paths: schema: format: date-time type: string - "400": + 400: content: {} description: Invalid username/password supplied summary: Logs user into the system @@ -543,10 +543,10 @@ paths: schema: type: string responses: - "400": + 400: content: {} description: Invalid username supplied - "404": + 404: content: {} description: User not found summary: Delete user @@ -564,7 +564,7 @@ paths: schema: type: string responses: - "200": + 200: content: application/xml: schema: @@ -573,10 +573,10 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - "400": + 400: content: {} description: Invalid username supplied - "404": + 404: content: {} description: User not found summary: Get user by user name @@ -602,10 +602,10 @@ paths: description: Updated user object required: true responses: - "400": + 400: content: {} description: Invalid user supplied - "404": + 404: content: {} description: User not found summary: Updated user diff --git a/samples/server/petstore/php-laravel/.openapi-generator/VERSION b/samples/server/petstore/php-laravel/.openapi-generator/VERSION index bfbf77eb7fad..479c313e87b9 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/VERSION +++ b/samples/server/petstore/php-laravel/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.0.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php index d883a0108d79..eddab9354c8f 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php @@ -57,7 +57,7 @@ public function testClientModel() /** * Operation testEndpointParameters * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트. + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트. * * * @return Http response @@ -441,48 +441,4 @@ public function fakeOuterStringSerialize() return response('How about implementing fakeOuterStringSerialize as a post method ?'); } - /** - * Operation testQueryParameterCollectionFormat - * - * . - * - * - * @return Http response - */ - public function testQueryParameterCollectionFormat() - { - $input = Request::all(); - - //path params validation - - - //not path params validation - if (!isset($input['pipe'])) { - throw new \InvalidArgumentException('Missing the required parameter $pipe when calling testQueryParameterCollectionFormat'); - } - $pipe = $input['pipe']; - - if (!isset($input['ioutil'])) { - throw new \InvalidArgumentException('Missing the required parameter $ioutil when calling testQueryParameterCollectionFormat'); - } - $ioutil = $input['ioutil']; - - if (!isset($input['http'])) { - throw new \InvalidArgumentException('Missing the required parameter $http when calling testQueryParameterCollectionFormat'); - } - $http = $input['http']; - - if (!isset($input['url'])) { - throw new \InvalidArgumentException('Missing the required parameter $url when calling testQueryParameterCollectionFormat'); - } - $url = $input['url']; - - if (!isset($input['context'])) { - throw new \InvalidArgumentException('Missing the required parameter $context when calling testQueryParameterCollectionFormat'); - } - $context = $input['context']; - - - return response('How about implementing testQueryParameterCollectionFormat as a put method ?'); - } } diff --git a/samples/server/petstore/php-laravel/lib/app/Models/FormatTest.php b/samples/server/petstore/php-laravel/lib/app/Models/FormatTest.php index e1846df04331..e5da81e096bb 100644 --- a/samples/server/petstore/php-laravel/lib/app/Models/FormatTest.php +++ b/samples/server/petstore/php-laravel/lib/app/Models/FormatTest.php @@ -48,7 +48,4 @@ class FormatTest { /** @var string $password */ private $password; - /** @var BigDecimal $bigDecimal */ - private $bigDecimal; - } diff --git a/samples/server/petstore/php-laravel/lib/app/Models/TypeHolderExample.php b/samples/server/petstore/php-laravel/lib/app/Models/TypeHolderExample.php index 12967fa2fc46..c2a3031995e6 100644 --- a/samples/server/petstore/php-laravel/lib/app/Models/TypeHolderExample.php +++ b/samples/server/petstore/php-laravel/lib/app/Models/TypeHolderExample.php @@ -15,9 +15,6 @@ class TypeHolderExample { /** @var float $numberItem */ private $numberItem; - /** @var float $floatItem */ - private $floatItem; - /** @var int $integerItem */ private $integerItem; diff --git a/samples/server/petstore/php-laravel/lib/routes/api.php b/samples/server/petstore/php-laravel/lib/routes/api.php index 0fd1c22d3efa..1cf047e59d8e 100644 --- a/samples/server/petstore/php-laravel/lib/routes/api.php +++ b/samples/server/petstore/php-laravel/lib/routes/api.php @@ -32,8 +32,8 @@ Route::patch('/v2/fake', 'FakeController@testClientModel'); /** * post testEndpointParameters - * Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Summary: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Notes: Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 */ Route::post('/v2/fake', 'FakeController@testEndpointParameters'); @@ -114,13 +114,6 @@ * Output-Formats: [*_/_*] */ Route::post('/v2/fake/outer/string', 'FakeController@fakeOuterStringSerialize'); -/** - * put testQueryParameterCollectionFormat - * Summary: - * Notes: To test the collection format in query parameters - - */ -Route::put('/v2/fake/test-query-paramters', 'FakeController@testQueryParameterCollectionFormat'); /** * patch testClassname * Summary: To test class name in snake case diff --git a/samples/server/petstore/python-blueplanet/.openapi-generator-ignore b/samples/server/petstore/python-blueplanet/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/python-blueplanet/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION new file mode 100644 index 000000000000..bfbf77eb7fad --- /dev/null +++ b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-blueplanet/README.md b/samples/server/petstore/python-blueplanet/README.md new file mode 100644 index 000000000000..a94ea0374837 --- /dev/null +++ b/samples/server/petstore/python-blueplanet/README.md @@ -0,0 +1,59 @@ +# openapi_server Swagger-ui and Resource Types + +This project is an autogenerated microservice for Ciena's Blueplanet platform. + +## Overview + +Generated code can be used as: + +* Resource Type generation for Resource Adapter Development +* Resource Type generation for Service Template Development +* Microservice for swagger based NBI + +Make Targets: + +image: Create Docker image for use as BluePlanet microservice +solution: Create Solution image + +Resource Types are generated in model-definitions directory + +## Usage + +### Creating new release + +1. Update RELEASE property in Makefile +2. Update release(s) in [fig.yml](solution/fig.yml) +3. make image and solution + + ```bash + # building the image + make image + make solution + ``` + +### Iterative Development + +1. A helper target can be used for pushing image and solution to server + + ```bash + make update REMOTE_SERVER=bpadmin@10.10.10.10 + ``` + +This `make` target does the following: + +1. creates App and Solution image +2. purges solution from MCP remote +3. pushes solution and image to MCP remote +4. deploys solution + +### Local Usage + +To run the server locally: + +```bash +cd app +pip3 install -r requirements.txt +python3 -m swagger_server +``` + +and open your browser to [here](http://localhost:8080/openapi_server/ui/) diff --git a/samples/server/petstore/python-blueplanet/requirements.txt b/samples/server/petstore/python-blueplanet/requirements.txt new file mode 100644 index 000000000000..08a16baf59c1 --- /dev/null +++ b/samples/server/petstore/python-blueplanet/requirements.txt @@ -0,0 +1,2 @@ +--extra-index-url https://pypi.blueplanet.com/simple/ +solution-maker==0.1.6 diff --git a/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION b/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION index bfbf77eb7fad..d168f1d8bdaa 100644 --- a/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION +++ b/samples/server/petstore/ruby-on-rails/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb b/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb index 27e270c494e2..fbf324f2d198 100644 --- a/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb +++ b/samples/server/petstore/ruby-on-rails/db/migrate/0_init_tables.rb @@ -25,6 +25,20 @@ def change t.timestamps end + create_table "inline_object".pluralize.to_sym, id: false do |t| + t.string :name + t.string :status + + t.timestamps + end + + create_table "inline_object_1".pluralize.to_sym, id: false do |t| + t.string :additional_metadata + t.File :file + + t.timestamps + end + create_table "order".pluralize.to_sym, id: false do |t| t.integer :id t.integer :pet_id diff --git a/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION b/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION index bfbf77eb7fad..d168f1d8bdaa 100644 --- a/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION +++ b/samples/server/petstore/ruby-sinatra/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/ruby-sinatra/openapi.yaml b/samples/server/petstore/ruby-sinatra/openapi.yaml index 0c61c2099572..2a48cecf82bb 100644 --- a/samples/server/petstore/ruby-sinatra/openapi.yaml +++ b/samples/server/petstore/ruby-sinatra/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -7,6 +7,9 @@ info: url: https://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io servers: - url: http://petstore.swagger.io/v2 tags: @@ -21,18 +24,9 @@ paths: post: operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: - "405": - content: {} + 405: description: Invalid input security: - petstore_auth: @@ -41,28 +35,16 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body put: operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: - "400": - content: {} + 400: description: Invalid ID supplied - "404": - content: {} + 404: description: Pet not found - "405": - content: {} + 405: description: Validation exception security: - petstore_auth: @@ -71,7 +53,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings @@ -93,7 +74,7 @@ paths: type: array style: form responses: - "200": + 200: content: application/xml: schema: @@ -106,12 +87,10 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - "400": - content: {} + 400: description: Invalid status value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by status tags: @@ -134,7 +113,7 @@ paths: type: array style: form responses: - "200": + 200: content: application/xml: schema: @@ -147,12 +126,10 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - "400": - content: {} + 400: description: Invalid tag value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by tags tags: @@ -161,20 +138,24 @@ paths: delete: operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: - "400": - content: {} + 400: description: Invalid pet value security: - petstore_auth: @@ -188,14 +169,16 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: - "200": + 200: content: application/xml: schema: @@ -204,11 +187,9 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - "400": - content: {} + 400: description: Invalid ID supplied - "404": - content: {} + 404: description: Pet not found security: - api_key: [] @@ -219,13 +200,16 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: @@ -236,9 +220,9 @@ paths: status: description: Updated status of the pet type: string + type: object responses: - "405": - content: {} + 405: description: Invalid input security: - petstore_auth: @@ -252,13 +236,16 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: @@ -270,8 +257,9 @@ paths: description: file to upload format: binary type: string + type: object responses: - "200": + 200: content: application/json: schema: @@ -289,7 +277,7 @@ paths: description: Returns a map of status codes to quantities operationId: getInventory responses: - "200": + 200: content: application/json: schema: @@ -308,13 +296,13 @@ paths: operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet required: true responses: - "200": + 200: content: application/xml: schema: @@ -323,13 +311,11 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - "400": - content: {} + 400: description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body /store/order/{orderId}: delete: description: For valid response try integer IDs with value < 1000. Anything @@ -337,17 +323,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: orderId required: true schema: type: string + style: simple responses: - "400": - content: {} + 400: description: Invalid ID supplied - "404": - content: {} + 404: description: Order not found summary: Delete purchase order by ID tags: @@ -358,6 +344,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: orderId required: true @@ -366,8 +353,9 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: - "200": + 200: content: application/xml: schema: @@ -376,11 +364,9 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - "400": - content: {} + 400: description: Invalid ID supplied - "404": - content: {} + 404: description: Order not found summary: Find purchase order by ID tags: @@ -391,77 +377,68 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Create user tags: - user - x-codegen-request-body-name: body /user/createWithArray: post: operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body /user/createWithList: post: operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body /user/login: get: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: - "200": + 200: content: application/xml: schema: @@ -471,18 +448,29 @@ paths: type: string description: successful operation headers: + Set-Cookie: + description: Cookie authentication key for use with the `auth_cookie` + apiKey authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when toekn expires + explode: false schema: format: date-time type: string - "400": - content: {} + style: simple + 400: description: Invalid username/password supplied summary: Logs user into the system tags: @@ -492,8 +480,9 @@ paths: operationId: logoutUser responses: default: - content: {} description: successful operation + security: + - auth_cookie: [] summary: Logs out current logged in user session tags: - user @@ -503,18 +492,20 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: - "400": - content: {} + 400: description: Invalid username supplied - "404": - content: {} + 404: description: User not found + security: + - auth_cookie: [] summary: Delete user tags: - user @@ -522,13 +513,15 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: - "200": + 200: content: application/xml: schema: @@ -537,11 +530,9 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - "400": - content: {} + 400: description: Invalid username supplied - "404": - content: {} + 404: description: User not found summary: Get user by user name tags: @@ -551,30 +542,61 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: - "400": - content: {} + 400: description: Invalid user supplied - "404": - content: {} + 404: description: User not found + security: + - auth_cookie: [] summary: Updated user tags: - user - x-codegen-request-body-name: body components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -622,6 +644,7 @@ components: format: int64 type: integer name: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string title: Pet category type: object @@ -747,6 +770,25 @@ components: type: string title: An uploaded response type: object + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object securitySchemes: petstore_auth: flows: @@ -760,3 +802,7 @@ components: in: header name: api_key type: apiKey + auth_cookie: + in: cookie + name: AUTH_KEY + type: apiKey diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/PetApi.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/PetApi.scala index 5f67e1fc4f56..a8f69306d8b4 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/PetApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/PetApi.scala @@ -41,13 +41,13 @@ class PetApi(implicit val swagger: Swagger) extends ScalatraServlet } - val addPetOperation = (apiOperation[Unit]("addPet") + val addPetOperation = (apiOperation[Pet]("addPet") summary "Add a new pet to the store" - parameters(bodyParam[Pet]("body").description("")) + parameters(bodyParam[Pet]("pet").description("")) ) post("/pet", operation(addPetOperation)) { - //println("body: " + body) + //println("pet: " + pet) } @@ -118,13 +118,13 @@ class PetApi(implicit val swagger: Swagger) extends ScalatraServlet - val updatePetOperation = (apiOperation[Unit]("updatePet") + val updatePetOperation = (apiOperation[Pet]("updatePet") summary "Update an existing pet" - parameters(bodyParam[Pet]("body").description("")) + parameters(bodyParam[Pet]("pet").description("")) ) put("/pet", operation(updatePetOperation)) { - //println("body: " + body) + //println("pet: " + pet) } diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/StoreApi.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/StoreApi.scala index 80414fef01ea..e640f4a3e28b 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/StoreApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/StoreApi.scala @@ -75,11 +75,11 @@ class StoreApi(implicit val swagger: Swagger) extends ScalatraServlet val placeOrderOperation = (apiOperation[Order]("placeOrder") summary "Place an order for a pet" - parameters(bodyParam[Order]("body").description("")) + parameters(bodyParam[Order]("order").description("")) ) post("/store/order", operation(placeOrderOperation)) { - //println("body: " + body) + //println("order: " + order) } } diff --git a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/UserApi.scala b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/UserApi.scala index ff7d9714d881..8cdc75071cf0 100644 --- a/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/UserApi.scala +++ b/samples/server/petstore/scalatra/src/main/scala/org/openapitools/server/api/UserApi.scala @@ -41,33 +41,33 @@ class UserApi(implicit val swagger: Swagger) extends ScalatraServlet val createUserOperation = (apiOperation[Unit]("createUser") summary "Create user" - parameters(bodyParam[User]("body").description("")) + parameters(bodyParam[User]("user").description("")) ) post("/user", operation(createUserOperation)) { - //println("body: " + body) + //println("user: " + user) } val createUsersWithArrayInputOperation = (apiOperation[Unit]("createUsersWithArrayInput") summary "Creates list of users with given input array" - parameters(bodyParam[List[User]]("body").description("")) + parameters(bodyParam[List[User]]("user").description("")) ) post("/user/createWithArray", operation(createUsersWithArrayInputOperation)) { - //println("body: " + body) + //println("user: " + user) } val createUsersWithListInputOperation = (apiOperation[Unit]("createUsersWithListInput") summary "Creates list of users with given input array" - parameters(bodyParam[List[User]]("body").description("")) + parameters(bodyParam[List[User]]("user").description("")) ) post("/user/createWithList", operation(createUsersWithListInputOperation)) { - //println("body: " + body) + //println("user: " + user) } @@ -124,13 +124,13 @@ class UserApi(implicit val swagger: Swagger) extends ScalatraServlet val updateUserOperation = (apiOperation[Unit]("updateUser") summary "Updated user" - parameters(pathParam[String]("username").description(""), bodyParam[User]("body").description("")) + parameters(pathParam[String]("username").description(""), bodyParam[User]("user").description("")) ) put("/user/:username", operation(updateUserOperation)) { val username = params.getOrElse("username", halt(400)) //println("username: " + username) - //println("body: " + body) + //println("user: " + user) } } From 015988138f1a850b512c5ef926a9637d1c8c5e6f Mon Sep 17 00:00:00 2001 From: Esteban Gehring Date: Mon, 27 Apr 2020 08:22:42 +0200 Subject: [PATCH 13/15] re-generate samples --- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../dart2/openapi/lib/api/pet_api.dart | 48 +++++++++---------- .../dart2/openapi/lib/api/store_api.dart | 24 +++++----- .../dart2/openapi/lib/api/user_api.dart | 48 +++++++++---------- .../dart2/openapi/lib/api_client.dart | 22 +++++---- .../go/go-petstore-withXml/api_fake.go | 2 +- .../petstore/go/go-petstore/api_fake.go | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../model/AdditionalPropertiesAnyType.java | 3 -- .../model/AdditionalPropertiesArray.java | 3 -- .../model/AdditionalPropertiesBoolean.java | 3 -- .../model/AdditionalPropertiesClass.java | 11 ----- .../model/AdditionalPropertiesInteger.java | 3 -- .../model/AdditionalPropertiesNumber.java | 3 -- .../model/AdditionalPropertiesObject.java | 3 -- .../model/AdditionalPropertiesString.java | 3 -- .../org/openapitools/client/model/Animal.java | 4 -- .../model/ArrayOfArrayOfNumberOnly.java | 4 -- .../client/model/ArrayOfNumberOnly.java | 4 -- .../openapitools/client/model/ArrayTest.java | 5 -- .../org/openapitools/client/model/BigCat.java | 3 -- .../client/model/BigCatAllOf.java | 3 -- .../client/model/Capitalization.java | 3 -- .../org/openapitools/client/model/Cat.java | 3 -- .../openapitools/client/model/CatAllOf.java | 3 -- .../openapitools/client/model/Category.java | 4 -- .../openapitools/client/model/ClassModel.java | 3 -- .../org/openapitools/client/model/Client.java | 3 -- .../org/openapitools/client/model/Dog.java | 3 -- .../openapitools/client/model/DogAllOf.java | 3 -- .../openapitools/client/model/EnumArrays.java | 3 -- .../openapitools/client/model/EnumClass.java | 3 -- .../openapitools/client/model/EnumTest.java | 5 -- .../client/model/FileSchemaTestClass.java | 5 -- .../openapitools/client/model/FormatTest.java | 29 ++++------- .../client/model/HasOnlyReadOnly.java | 3 -- .../openapitools/client/model/MapTest.java | 4 -- ...ropertiesAndAdditionalPropertiesClass.java | 6 --- .../client/model/Model200Response.java | 3 -- .../client/model/ModelApiResponse.java | 3 -- .../client/model/ModelReturn.java | 3 -- .../org/openapitools/client/model/Name.java | 4 -- .../openapitools/client/model/NumberOnly.java | 4 -- .../org/openapitools/client/model/Order.java | 4 -- .../client/model/OuterComposite.java | 4 -- .../openapitools/client/model/OuterEnum.java | 3 -- .../org/openapitools/client/model/Pet.java | 7 --- .../client/model/ReadOnlyFirst.java | 3 -- .../client/model/SpecialModelName.java | 3 -- .../org/openapitools/client/model/Tag.java | 3 -- .../client/model/TypeHolderDefault.java | 9 ---- .../client/model/TypeHolderExample.java | 10 ---- .../org/openapitools/client/model/User.java | 3 -- .../openapitools/client/model/XmlItem.java | 8 ---- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../openapitools/client/api/FakeApiImpl.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../javascript-es6/src/api/FakeApi.js | 2 +- .../javascript-promise-es6/src/api/FakeApi.js | 2 +- .../javascript-promise/src/api/FakeApi.js | 2 +- .../petstore/javascript/src/api/FakeApi.js | 2 +- .../petstore_api/api/fake_api.py | 2 +- .../petstore_api/api/fake_api.py | 2 +- .../python/petstore_api/api/fake_api.py | 2 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_api.rb | 2 +- .../python/petstore_api/api/fake_api.py | 2 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_api.rb | 2 +- .../app/controllers/FakeApiController.java | 2 +- .../php-slim4/lib/Model/EnumClass.php | 4 +- 90 files changed, 126 insertions(+), 318 deletions(-) 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 a4ab49f4424d..02a246e64f9c 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 @@ -2697,7 +2697,7 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); } if (url != null) { @@ -2795,7 +2795,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); } if (url != 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 a4ab49f4424d..02a246e64f9c 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 @@ -2697,7 +2697,7 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); } if (url != null) { @@ -2795,7 +2795,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index e7f144292bb9..df35324cc5cd 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -2949,7 +2949,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3038,7 +3038,7 @@ public async System.Threading.Tasks.Task> TestQueryParameter if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart index 2b00c7d63b73..a413df7b4242 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart @@ -28,10 +28,10 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -46,7 +46,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -86,10 +86,10 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -104,7 +104,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -144,10 +144,10 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -162,7 +162,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -203,10 +203,10 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -221,7 +221,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -261,10 +261,10 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["api_key"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -279,7 +279,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -319,10 +319,10 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -337,7 +337,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -376,10 +376,10 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if (name != null) { @@ -406,7 +406,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -445,10 +445,10 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if (additionalMetadata != null) { @@ -474,7 +474,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } diff --git a/samples/client/petstore/dart2/openapi/lib/api/store_api.dart b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart index 3b48cbbc4a3b..10dc4a35b85a 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart @@ -28,10 +28,10 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -46,7 +46,7 @@ class StoreApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -82,10 +82,10 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["api_key"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -100,7 +100,7 @@ class StoreApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -141,10 +141,10 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -159,7 +159,7 @@ class StoreApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -199,10 +199,10 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -217,7 +217,7 @@ class StoreApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } diff --git a/samples/client/petstore/dart2/openapi/lib/api/user_api.dart b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart index 5a35ba394c08..a940ca410713 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart @@ -28,10 +28,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -46,7 +46,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -85,10 +85,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -103,7 +103,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -142,10 +142,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -160,7 +160,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -199,10 +199,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -217,7 +217,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -256,10 +256,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -274,7 +274,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -319,10 +319,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -337,7 +337,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -374,10 +374,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -392,7 +392,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -434,10 +434,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -452,7 +452,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } diff --git a/samples/client/petstore/dart2/openapi/lib/api_client.dart b/samples/client/petstore/dart2/openapi/lib/api_client.dart index 793ac6a73410..d68c9691879f 100644 --- a/samples/client/petstore/dart2/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart2/openapi/lib/api_client.dart @@ -100,7 +100,7 @@ class ApiClient { Object body, Map headerParams, Map formParams, - String contentType, + String nullableContentType, List authNames) async { _updateParamsForAuth(authNames, queryParams, headerParams); @@ -116,7 +116,10 @@ class ApiClient { String url = basePath + path + queryString; headerParams.addAll(_defaultHeaderMap); - headerParams['Content-Type'] = contentType; + if (nullableContentType != null) { + final contentType = nullableContentType; + headerParams['Content-Type'] = contentType; + } if(body is MultipartRequest) { var request = MultipartRequest(method, Uri.parse(url)); @@ -127,20 +130,21 @@ class ApiClient { var response = await client.send(request); return Response.fromStream(response); } else { - var msgBody = contentType == "application/x-www-form-urlencoded" ? formParams : serialize(body); + var msgBody = nullableContentType == "application/x-www-form-urlencoded" ? formParams : serialize(body); + final nullableHeaderParams = (headerParams.isEmpty)? null: headerParams; switch(method) { case "POST": - return client.post(url, headers: headerParams, body: msgBody); + return client.post(url, headers: nullableHeaderParams, body: msgBody); case "PUT": - return client.put(url, headers: headerParams, body: msgBody); + return client.put(url, headers: nullableHeaderParams, body: msgBody); case "DELETE": - return client.delete(url, headers: headerParams); + return client.delete(url, headers: nullableHeaderParams); case "PATCH": - return client.patch(url, headers: headerParams, body: msgBody); + return client.patch(url, headers: nullableHeaderParams, body: msgBody); case "HEAD": - return client.head(url, headers: headerParams); + return client.head(url, headers: nullableHeaderParams); default: - return client.get(url, headers: headerParams); + return client.get(url, headers: nullableHeaderParams); } } } 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 5d60b36436c9..2c5f9b2149b1 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -1170,7 +1170,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("http", parameterToString(http, "ssv")) localVarQueryParams.Add("url", parameterToString(url, "csv")) { t:=context diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index ac3402fe4e4a..5978577ddff1 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -1169,7 +1169,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("http", parameterToString(http, "ssv")) localVarQueryParams.Add("url", parameterToString(url, "csv")) { t:=context diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java index 69cc2a9064f6..7648f4c650fa 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java @@ -407,7 +407,7 @@ public TestQueryParameterCollectionFormatQueryParams ioutil(final List v return this; } public TestQueryParameterCollectionFormatQueryParams http(final List value) { - put("http", EncodingUtils.encodeCollection(value, "space")); + put("http", EncodingUtils.encodeCollection(value, "ssv")); return this; } public TestQueryParameterCollectionFormatQueryParams url(final List value) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java index 69cc2a9064f6..7648f4c650fa 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java @@ -407,7 +407,7 @@ public TestQueryParameterCollectionFormatQueryParams ioutil(final List v return this; } public TestQueryParameterCollectionFormatQueryParams http(final List value) { - put("http", EncodingUtils.encodeCollection(value, "space")); + put("http", EncodingUtils.encodeCollection(value, "ssv")); return this; } public TestQueryParameterCollectionFormatQueryParams url(final List value) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java index ea1d42bae884..3c3ca7c4c9c9 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java @@ -760,7 +760,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java index 6410a95d1731..506535e1d33e 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1149,7 +1149,7 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List testQueryParameterCollectionFormatWithHttpInfo(List testQueryParameterCollectionFormatWithHttpInfo(List pipe, List i List localVarQueryParams = new ArrayList<>(); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(ApiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("ssv", "http", http)); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 121867dd07a9..657e2dfd968b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1791,7 +1791,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } if (http != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 121867dd07a9..657e2dfd968b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1791,7 +1791,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } if (http != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index aba19948f055..79c169543fde 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesAnyType diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index bb35b0970ef4..e16ee861f893 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -26,9 +26,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesArray diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b3528f7a8722..29161b52aa16 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesBoolean diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 9b270abdb56e..a067b01ec979 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -27,9 +27,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesClass @@ -131,7 +128,6 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * @return mapNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Map getMapNumber() { @@ -225,7 +221,6 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { @@ -257,7 +252,6 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List * @return mapArrayAnytype **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Map> getMapArrayAnytype() { @@ -289,7 +283,6 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { @@ -321,7 +314,6 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { @@ -345,7 +337,6 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { * @return anytype1 **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Object getAnytype1() { @@ -369,7 +360,6 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { * @return anytype2 **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Object getAnytype2() { @@ -393,7 +383,6 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { * @return anytype3 **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Object getAnytype3() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 574b6ad8f1bb..3a15ed7cd977 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesInteger diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index c138d835e55a..9bc46e099916 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -26,9 +26,6 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesNumber diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 48bd74a65a60..bd65f7791c5e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesObject diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8be8dcd782d6..cdb8afedaaf4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesString diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java index 4cbc678b5321..cea2ff5988d7 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Animal @@ -55,7 +52,6 @@ public Animal className(String className) { * Get className * @return className **/ - @NotNull @ApiModelProperty(required = true, value = "") public String getClassName() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 9db163e71534..a6dd760660d5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -26,9 +26,6 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * ArrayOfArrayOfNumberOnly @@ -59,7 +56,6 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr * @return arrayArrayNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public List> getArrayArrayNumber() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 02106b473bc8..487c539d3bac 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -26,9 +26,6 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * ArrayOfNumberOnly @@ -59,7 +56,6 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * @return arrayNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public List getArrayNumber() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java index 4ec8e611d8c6..7d66ce233feb 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -26,9 +26,6 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * ArrayTest @@ -98,7 +95,6 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * @return arrayArrayOfInteger **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { @@ -130,7 +126,6 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * @return arrayArrayOfModel **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java index 14436bf9f98a..74b7ddc8135b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java @@ -25,9 +25,6 @@ import java.io.IOException; import org.openapitools.client.model.BigCatAllOf; import org.openapitools.client.model.Cat; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * BigCat diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java index eaa296451029..cd2207704bd1 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * BigCatAllOf diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java index 90db42f19630..d4fbec81c543 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Capitalization diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java index 1d89f2afd131..e5a45ef03d89 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java @@ -25,9 +25,6 @@ import java.io.IOException; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Cat diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java index 6061abfee808..3299c8ea8776 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * CatAllOf diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java index 1837174952ac..4d07c3a1bef1 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Category @@ -74,7 +71,6 @@ public Category name(String name) { * Get name * @return name **/ - @NotNull @ApiModelProperty(required = true, value = "") public String getName() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java index 8bda0bd8381d..8867bdd06bf0 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Model for testing model with \"_class\" property diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java index e72113def905..25831260e09b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Client diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java index 174de6bb5bef..89c8b6aba99b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java @@ -25,9 +25,6 @@ import java.io.IOException; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Dog diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java index dc2f0f751e63..b945c2c33db4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * DogAllOf diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java index 0fd2de659e99..2512b4cf9d52 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * EnumArrays diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java index ae6366ff6196..b9a78241a5a7 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java @@ -16,9 +16,6 @@ import java.util.Objects; import java.util.Arrays; import com.google.gson.annotations.SerializedName; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; import java.io.IOException; import com.google.gson.TypeAdapter; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java index 5fa3c853a032..ccbbabaa9ba5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java @@ -24,9 +24,6 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.OuterEnum; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * EnumTest @@ -279,7 +276,6 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired **/ - @NotNull @ApiModelProperty(required = true, value = "") public EnumStringRequiredEnum getEnumStringRequired() { @@ -349,7 +345,6 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * @return outerEnum **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index eb73f8f1e4a6..f4a15cd5b7fd 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * FileSchemaTestClass @@ -54,7 +51,6 @@ public FileSchemaTestClass file(java.io.File file) { * @return file **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public java.io.File getFile() { @@ -86,7 +82,6 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * @return files **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public List getFiles() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java index c05d5a9485e9..5983420c81b1 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java @@ -28,9 +28,6 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * FormatTest @@ -107,7 +104,7 @@ public FormatTest integer(Integer integer) { * @return integer **/ @javax.annotation.Nullable - @Min(10) @Max(100) @ApiModelProperty(value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; @@ -132,7 +129,7 @@ public FormatTest int32(Integer int32) { * @return int32 **/ @javax.annotation.Nullable - @Min(20) @Max(200) @ApiModelProperty(value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; @@ -179,9 +176,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number **/ - @NotNull - @Valid - @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; @@ -206,7 +201,7 @@ public FormatTest _float(Float _float) { * @return _float **/ @javax.annotation.Nullable - @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; @@ -231,7 +226,7 @@ public FormatTest _double(Double _double) { * @return _double **/ @javax.annotation.Nullable - @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; @@ -254,7 +249,7 @@ public FormatTest string(String string) { * @return string **/ @javax.annotation.Nullable - @Pattern(regexp="/[a-z]/i") @ApiModelProperty(value = "") + @ApiModelProperty(value = "") public String getString() { return string; @@ -276,8 +271,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte **/ - @NotNull - @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @ApiModelProperty(required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; @@ -300,7 +294,6 @@ public FormatTest binary(File binary) { * @return binary **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public File getBinary() { @@ -323,8 +316,6 @@ public FormatTest date(LocalDate date) { * Get date * @return date **/ - @NotNull - @Valid @ApiModelProperty(required = true, value = "") public LocalDate getDate() { @@ -348,7 +339,6 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * @return dateTime **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { @@ -372,7 +362,6 @@ public FormatTest uuid(UUID uuid) { * @return uuid **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") public UUID getUuid() { @@ -395,8 +384,7 @@ public FormatTest password(String password) { * Get password * @return password **/ - @NotNull - @Size(min=10,max=64) @ApiModelProperty(required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; @@ -419,7 +407,6 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * @return bigDecimal **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public BigDecimal getBigDecimal() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index b5f9d033d1fc..8fcb26846436 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * HasOnlyReadOnly diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java index d2d1452e028a..7dc68b0ff00f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,9 +26,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * MapTest @@ -118,7 +115,6 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * @return mapMapOfString **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Map> getMapMapOfString() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ee8f4a7f9bb5..527853d7522c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -29,9 +29,6 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * MixedPropertiesAndAdditionalPropertiesClass @@ -62,7 +59,6 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * @return uuid **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public UUID getUuid() { @@ -86,7 +82,6 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * @return dateTime **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { @@ -118,7 +113,6 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Map getMap() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java index 55328ed3accd..df3683dac78d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Model for testing model name starting with number diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 9fb06422b55f..b9cf72823b2f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * ModelApiResponse diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java index 84afadc74399..6e9714df977d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Model for testing reserved words diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java index ddea46f4bf1e..94117a9b0f4b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Model for testing model name same as property name @@ -60,7 +57,6 @@ public Name name(Integer name) { * Get name * @return name **/ - @NotNull @ApiModelProperty(required = true, value = "") public Integer getName() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java index 5ea3f679be6f..9a55d8aa615f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -24,9 +24,6 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * NumberOnly @@ -49,7 +46,6 @@ public NumberOnly justNumber(BigDecimal justNumber) { * @return justNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public BigDecimal getJustNumber() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java index 40eed7b5db9d..4e41a3dc88ea 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java @@ -24,9 +24,6 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.threeten.bp.OffsetDateTime; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Order @@ -187,7 +184,6 @@ public Order shipDate(OffsetDateTime shipDate) { * @return shipDate **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java index fef7f5812aa0..96b1237f82fa 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -24,9 +24,6 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * OuterComposite @@ -57,7 +54,6 @@ public OuterComposite myNumber(BigDecimal myNumber) { * @return myNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public BigDecimal getMyNumber() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java index be690856408e..bd870812102c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -16,9 +16,6 @@ import java.util.Objects; import java.util.Arrays; import com.google.gson.annotations.SerializedName; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; import java.io.IOException; import com.google.gson.TypeAdapter; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java index a20c1cfcdd5e..e50743626b47 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java @@ -27,9 +27,6 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Pet @@ -144,7 +141,6 @@ public Pet category(Category category) { * @return category **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Category getCategory() { @@ -167,7 +163,6 @@ public Pet name(String name) { * Get name * @return name **/ - @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { @@ -195,7 +190,6 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls **/ - @NotNull @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { @@ -227,7 +221,6 @@ public Pet addTagsItem(Tag tagsItem) { * @return tags **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public List getTags() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index d034413519b5..ed0244a3ca27 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * ReadOnlyFirst diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java index 45f9e21f8b63..3405d30ff614 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * SpecialModelName diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java index 315b9180f676..710e0fe54a4e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Tag diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index bbe170f19845..b6cea1fd768c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -26,9 +26,6 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * TypeHolderDefault @@ -66,7 +63,6 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem **/ - @NotNull @ApiModelProperty(required = true, value = "") public String getStringItem() { @@ -89,8 +85,6 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem **/ - @NotNull - @Valid @ApiModelProperty(required = true, value = "") public BigDecimal getNumberItem() { @@ -113,7 +107,6 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem **/ - @NotNull @ApiModelProperty(required = true, value = "") public Integer getIntegerItem() { @@ -136,7 +129,6 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem **/ - @NotNull @ApiModelProperty(required = true, value = "") public Boolean isBoolItem() { @@ -164,7 +156,6 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem **/ - @NotNull @ApiModelProperty(required = true, value = "") public List getArrayItem() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java index daa84d59ba9e..787d0123cce9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -26,9 +26,6 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * TypeHolderExample @@ -70,7 +67,6 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem **/ - @NotNull @ApiModelProperty(example = "what", required = true, value = "") public String getStringItem() { @@ -93,8 +89,6 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem **/ - @NotNull - @Valid @ApiModelProperty(example = "1.234", required = true, value = "") public BigDecimal getNumberItem() { @@ -117,7 +111,6 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem **/ - @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") public Float getFloatItem() { @@ -140,7 +133,6 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem **/ - @NotNull @ApiModelProperty(example = "-2", required = true, value = "") public Integer getIntegerItem() { @@ -163,7 +155,6 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem **/ - @NotNull @ApiModelProperty(example = "true", required = true, value = "") public Boolean isBoolItem() { @@ -191,7 +182,6 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem **/ - @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") public List getArrayItem() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java index 760ff3053791..d91115317819 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * User diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java index d1bae238ba51..44f00ecc1bd0 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java @@ -26,9 +26,6 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * XmlItem @@ -186,7 +183,6 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * @return attributeNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getAttributeNumber() { @@ -310,7 +306,6 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * @return nameNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getNameNumber() { @@ -465,7 +460,6 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * @return prefixNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getPrefixNumber() { @@ -620,7 +614,6 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * @return namespaceNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getNamespaceNumber() { @@ -775,7 +768,6 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * @return prefixNsNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getPrefixNsNumber() { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java index 34b1bf258781..bd2b2386f2bc 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java @@ -732,7 +732,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java index 16ef84563250..2c5be6cd0ecb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java @@ -852,7 +852,7 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java index 16ef84563250..2c5be6cd0ecb 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java @@ -852,7 +852,7 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java index 1ce6dc060c27..1bfe577e26ca 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java @@ -408,7 +408,7 @@ void testJsonFormData( @PUT("/fake/test-query-paramters") Void testQueryParameterCollectionFormat( - @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SSVParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context ); /** @@ -424,6 +424,6 @@ Void testQueryParameterCollectionFormat( @PUT("/fake/test-query-paramters") void testQueryParameterCollectionFormat( - @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context, Callback cb + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SSVParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java index 0c05259fb1e8..b1a773c63d71 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ F.Promise> testJsonFormData( */ @PUT("fake/test-query-paramters") F.Promise> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java index f8a5c1f9ec2f..a9c8e3f16da0 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ CompletionStage> testJsonFormData( */ @PUT("fake/test-query-paramters") CompletionStage> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java index f8a5c1f9ec2f..a9c8e3f16da0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ CompletionStage> testJsonFormData( */ @PUT("fake/test-query-paramters") CompletionStage> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java index d536945d5d43..dbaa2f6d1b76 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -225,7 +225,7 @@ Call testJsonFormData( */ @PUT("fake/test-query-paramters") Call testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java index b17c3d20f2b4..438c244adc70 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -225,7 +225,7 @@ Observable testJsonFormData( */ @PUT("fake/test-query-paramters") Observable testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java index 82a7657309f2..a2d7e57449e9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -226,7 +226,7 @@ Completable testJsonFormData( */ @PUT("fake/test-query-paramters") Completable testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java index e32629442fd5..70b3577d960b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -650,7 +650,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i List localVarQueryParams = new ArrayList<>(); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index 186f35269cd7..46aded06d3f6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -626,7 +626,7 @@ public Mono testQueryParameterCollectionFormat(List pipe, List httpList = OpenAPIUtils.parametersToList("space", httpArray); + List httpList = OpenAPIUtils.parametersToList("ssv", httpArray); List http = new ArrayList(); for (String curParam : httpList) { if (!curParam.isEmpty()) { diff --git a/samples/server/petstore/php-slim4/lib/Model/EnumClass.php b/samples/server/petstore/php-slim4/lib/Model/EnumClass.php index c3998d8602c5..3ddd829b3137 100644 --- a/samples/server/petstore/php-slim4/lib/Model/EnumClass.php +++ b/samples/server/petstore/php-slim4/lib/Model/EnumClass.php @@ -30,8 +30,8 @@ class EnumClass implements ModelInterface private const MODEL_SCHEMA = <<<'SCHEMA' { "type" : "string", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] } SCHEMA; From cf5c668f1883aaa5e268810a2afb999e14b3c4bd Mon Sep 17 00:00:00 2001 From: Esteban Gehring Date: Mon, 27 Apr 2020 16:08:15 +0200 Subject: [PATCH 14/15] reset samples to master --- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../dart2/openapi/lib/api/pet_api.dart | 48 +++++++++---------- .../dart2/openapi/lib/api/store_api.dart | 24 +++++----- .../dart2/openapi/lib/api/user_api.dart | 48 +++++++++---------- .../dart2/openapi/lib/api_client.dart | 22 ++++----- .../go/go-petstore-withXml/api_fake.go | 2 +- .../petstore/go/go-petstore/api_fake.go | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../model/AdditionalPropertiesAnyType.java | 3 ++ .../model/AdditionalPropertiesArray.java | 3 ++ .../model/AdditionalPropertiesBoolean.java | 3 ++ .../model/AdditionalPropertiesClass.java | 11 +++++ .../model/AdditionalPropertiesInteger.java | 3 ++ .../model/AdditionalPropertiesNumber.java | 3 ++ .../model/AdditionalPropertiesObject.java | 3 ++ .../model/AdditionalPropertiesString.java | 3 ++ .../org/openapitools/client/model/Animal.java | 4 ++ .../model/ArrayOfArrayOfNumberOnly.java | 4 ++ .../client/model/ArrayOfNumberOnly.java | 4 ++ .../openapitools/client/model/ArrayTest.java | 5 ++ .../org/openapitools/client/model/BigCat.java | 3 ++ .../client/model/BigCatAllOf.java | 3 ++ .../client/model/Capitalization.java | 3 ++ .../org/openapitools/client/model/Cat.java | 3 ++ .../openapitools/client/model/CatAllOf.java | 3 ++ .../openapitools/client/model/Category.java | 4 ++ .../openapitools/client/model/ClassModel.java | 3 ++ .../org/openapitools/client/model/Client.java | 3 ++ .../org/openapitools/client/model/Dog.java | 3 ++ .../openapitools/client/model/DogAllOf.java | 3 ++ .../openapitools/client/model/EnumArrays.java | 3 ++ .../openapitools/client/model/EnumClass.java | 3 ++ .../openapitools/client/model/EnumTest.java | 5 ++ .../client/model/FileSchemaTestClass.java | 5 ++ .../openapitools/client/model/FormatTest.java | 29 +++++++---- .../client/model/HasOnlyReadOnly.java | 3 ++ .../openapitools/client/model/MapTest.java | 4 ++ ...ropertiesAndAdditionalPropertiesClass.java | 6 +++ .../client/model/Model200Response.java | 3 ++ .../client/model/ModelApiResponse.java | 3 ++ .../client/model/ModelReturn.java | 3 ++ .../org/openapitools/client/model/Name.java | 4 ++ .../openapitools/client/model/NumberOnly.java | 4 ++ .../org/openapitools/client/model/Order.java | 4 ++ .../client/model/OuterComposite.java | 4 ++ .../openapitools/client/model/OuterEnum.java | 3 ++ .../org/openapitools/client/model/Pet.java | 7 +++ .../client/model/ReadOnlyFirst.java | 3 ++ .../client/model/SpecialModelName.java | 3 ++ .../org/openapitools/client/model/Tag.java | 3 ++ .../client/model/TypeHolderDefault.java | 9 ++++ .../client/model/TypeHolderExample.java | 10 ++++ .../org/openapitools/client/model/User.java | 3 ++ .../openapitools/client/model/XmlItem.java | 8 ++++ .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../openapitools/client/api/FakeApiImpl.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../javascript-es6/src/api/FakeApi.js | 2 +- .../javascript-promise-es6/src/api/FakeApi.js | 2 +- .../javascript-promise/src/api/FakeApi.js | 2 +- .../petstore/javascript/src/api/FakeApi.js | 2 +- .../petstore_api/api/fake_api.py | 2 +- .../petstore_api/api/fake_api.py | 2 +- .../python/petstore_api/api/fake_api.py | 2 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_api.rb | 2 +- .../python/petstore_api/api/fake_api.py | 2 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_api.rb | 2 +- .../app/controllers/FakeApiController.java | 2 +- .../php-slim4/lib/Model/EnumClass.php | 4 +- 90 files changed, 318 insertions(+), 126 deletions(-) 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 02a246e64f9c..a4ab49f4424d 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 @@ -2697,7 +2697,7 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); } if (url != null) { @@ -2795,7 +2795,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); } if (url != 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 02a246e64f9c..a4ab49f4424d 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 @@ -2697,7 +2697,7 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); } if (url != null) { @@ -2795,7 +2795,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index df35324cc5cd..e7f144292bb9 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -2949,7 +2949,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3038,7 +3038,7 @@ public async System.Threading.Tasks.Task> TestQueryParameter if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart index a413df7b4242..2b00c7d63b73 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart @@ -28,10 +28,10 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -46,7 +46,7 @@ class PetApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -86,10 +86,10 @@ class PetApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -104,7 +104,7 @@ class PetApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -144,10 +144,10 @@ class PetApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -162,7 +162,7 @@ class PetApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -203,10 +203,10 @@ class PetApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -221,7 +221,7 @@ class PetApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -261,10 +261,10 @@ class PetApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -279,7 +279,7 @@ class PetApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -319,10 +319,10 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -337,7 +337,7 @@ class PetApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -376,10 +376,10 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if (name != null) { @@ -406,7 +406,7 @@ class PetApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -445,10 +445,10 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if (additionalMetadata != null) { @@ -474,7 +474,7 @@ class PetApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } diff --git a/samples/client/petstore/dart2/openapi/lib/api/store_api.dart b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart index 10dc4a35b85a..3b48cbbc4a3b 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart @@ -28,10 +28,10 @@ class StoreApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -46,7 +46,7 @@ class StoreApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -82,10 +82,10 @@ class StoreApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -100,7 +100,7 @@ class StoreApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -141,10 +141,10 @@ class StoreApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -159,7 +159,7 @@ class StoreApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -199,10 +199,10 @@ class StoreApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -217,7 +217,7 @@ class StoreApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } diff --git a/samples/client/petstore/dart2/openapi/lib/api/user_api.dart b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart index a940ca410713..5a35ba394c08 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart @@ -28,10 +28,10 @@ class UserApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -46,7 +46,7 @@ class UserApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -85,10 +85,10 @@ class UserApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -103,7 +103,7 @@ class UserApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -142,10 +142,10 @@ class UserApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -160,7 +160,7 @@ class UserApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -199,10 +199,10 @@ class UserApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -217,7 +217,7 @@ class UserApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -256,10 +256,10 @@ class UserApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -274,7 +274,7 @@ class UserApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -319,10 +319,10 @@ class UserApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -337,7 +337,7 @@ class UserApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -374,10 +374,10 @@ class UserApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -392,7 +392,7 @@ class UserApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } @@ -434,10 +434,10 @@ class UserApi { List contentTypes = []; - String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; - if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { + if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -452,7 +452,7 @@ class UserApi { postBody, headerParams, formParams, - nullableContentType, + contentType, authNames); return response; } diff --git a/samples/client/petstore/dart2/openapi/lib/api_client.dart b/samples/client/petstore/dart2/openapi/lib/api_client.dart index d68c9691879f..793ac6a73410 100644 --- a/samples/client/petstore/dart2/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart2/openapi/lib/api_client.dart @@ -100,7 +100,7 @@ class ApiClient { Object body, Map headerParams, Map formParams, - String nullableContentType, + String contentType, List authNames) async { _updateParamsForAuth(authNames, queryParams, headerParams); @@ -116,10 +116,7 @@ class ApiClient { String url = basePath + path + queryString; headerParams.addAll(_defaultHeaderMap); - if (nullableContentType != null) { - final contentType = nullableContentType; - headerParams['Content-Type'] = contentType; - } + headerParams['Content-Type'] = contentType; if(body is MultipartRequest) { var request = MultipartRequest(method, Uri.parse(url)); @@ -130,21 +127,20 @@ class ApiClient { var response = await client.send(request); return Response.fromStream(response); } else { - var msgBody = nullableContentType == "application/x-www-form-urlencoded" ? formParams : serialize(body); - final nullableHeaderParams = (headerParams.isEmpty)? null: headerParams; + var msgBody = contentType == "application/x-www-form-urlencoded" ? formParams : serialize(body); switch(method) { case "POST": - return client.post(url, headers: nullableHeaderParams, body: msgBody); + return client.post(url, headers: headerParams, body: msgBody); case "PUT": - return client.put(url, headers: nullableHeaderParams, body: msgBody); + return client.put(url, headers: headerParams, body: msgBody); case "DELETE": - return client.delete(url, headers: nullableHeaderParams); + return client.delete(url, headers: headerParams); case "PATCH": - return client.patch(url, headers: nullableHeaderParams, body: msgBody); + return client.patch(url, headers: headerParams, body: msgBody); case "HEAD": - return client.head(url, headers: nullableHeaderParams); + return client.head(url, headers: headerParams); default: - return client.get(url, headers: nullableHeaderParams); + return client.get(url, headers: headerParams); } } } 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 2c5f9b2149b1..5d60b36436c9 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -1170,7 +1170,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "ssv")) + localVarQueryParams.Add("http", parameterToString(http, "space")) localVarQueryParams.Add("url", parameterToString(url, "csv")) { t:=context diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 5978577ddff1..ac3402fe4e4a 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -1169,7 +1169,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "ssv")) + localVarQueryParams.Add("http", parameterToString(http, "space")) localVarQueryParams.Add("url", parameterToString(url, "csv")) { t:=context diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java index 7648f4c650fa..69cc2a9064f6 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java @@ -407,7 +407,7 @@ public TestQueryParameterCollectionFormatQueryParams ioutil(final List v return this; } public TestQueryParameterCollectionFormatQueryParams http(final List value) { - put("http", EncodingUtils.encodeCollection(value, "ssv")); + put("http", EncodingUtils.encodeCollection(value, "space")); return this; } public TestQueryParameterCollectionFormatQueryParams url(final List value) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java index 7648f4c650fa..69cc2a9064f6 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java @@ -407,7 +407,7 @@ public TestQueryParameterCollectionFormatQueryParams ioutil(final List v return this; } public TestQueryParameterCollectionFormatQueryParams http(final List value) { - put("http", EncodingUtils.encodeCollection(value, "ssv")); + put("http", EncodingUtils.encodeCollection(value, "space")); return this; } public TestQueryParameterCollectionFormatQueryParams url(final List value) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java index 3c3ca7c4c9c9..ea1d42bae884 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java @@ -760,7 +760,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java index 506535e1d33e..6410a95d1731 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1149,7 +1149,7 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List testQueryParameterCollectionFormatWithHttpInfo(List testQueryParameterCollectionFormatWithHttpInfo(List pipe, List i List localVarQueryParams = new ArrayList<>(); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(ApiClient.parameterToPairs("ssv", "http", http)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("space", "http", http)); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 657e2dfd968b..121867dd07a9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1791,7 +1791,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } if (http != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http)); + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 657e2dfd968b..121867dd07a9 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1791,7 +1791,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } if (http != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http)); + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 79c169543fde..aba19948f055 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -25,6 +25,9 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesAnyType diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index e16ee861f893..bb35b0970ef4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -26,6 +26,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesArray diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 29161b52aa16..b3528f7a8722 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -25,6 +25,9 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesBoolean diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index a067b01ec979..9b270abdb56e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -27,6 +27,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesClass @@ -128,6 +131,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * @return mapNumber **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public Map getMapNumber() { @@ -221,6 +225,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { @@ -252,6 +257,7 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List * @return mapArrayAnytype **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public Map> getMapArrayAnytype() { @@ -283,6 +289,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { @@ -314,6 +321,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { @@ -337,6 +345,7 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { * @return anytype1 **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public Object getAnytype1() { @@ -360,6 +369,7 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { * @return anytype2 **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public Object getAnytype2() { @@ -383,6 +393,7 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { * @return anytype3 **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public Object getAnytype3() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 3a15ed7cd977..574b6ad8f1bb 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -25,6 +25,9 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesInteger diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 9bc46e099916..c138d835e55a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -26,6 +26,9 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesNumber diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bd65f7791c5e..48bd74a65a60 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -25,6 +25,9 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesObject diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index cdb8afedaaf4..8be8dcd782d6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -25,6 +25,9 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesString diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java index cea2ff5988d7..4cbc678b5321 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Animal @@ -52,6 +55,7 @@ public Animal className(String className) { * Get className * @return className **/ + @NotNull @ApiModelProperty(required = true, value = "") public String getClassName() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index a6dd760660d5..9db163e71534 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -26,6 +26,9 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * ArrayOfArrayOfNumberOnly @@ -56,6 +59,7 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr * @return arrayArrayNumber **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public List> getArrayArrayNumber() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 487c539d3bac..02106b473bc8 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -26,6 +26,9 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * ArrayOfNumberOnly @@ -56,6 +59,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * @return arrayNumber **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public List getArrayNumber() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java index 7d66ce233feb..4ec8e611d8c6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -26,6 +26,9 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * ArrayTest @@ -95,6 +98,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * @return arrayArrayOfInteger **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { @@ -126,6 +130,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * @return arrayArrayOfModel **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java index 74b7ddc8135b..14436bf9f98a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java @@ -25,6 +25,9 @@ import java.io.IOException; import org.openapitools.client.model.BigCatAllOf; import org.openapitools.client.model.Cat; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * BigCat diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java index cd2207704bd1..eaa296451029 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * BigCatAllOf diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java index d4fbec81c543..90db42f19630 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Capitalization diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java index e5a45ef03d89..1d89f2afd131 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java @@ -25,6 +25,9 @@ import java.io.IOException; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Cat diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java index 3299c8ea8776..6061abfee808 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * CatAllOf diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java index 4d07c3a1bef1..1837174952ac 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Category @@ -71,6 +74,7 @@ public Category name(String name) { * Get name * @return name **/ + @NotNull @ApiModelProperty(required = true, value = "") public String getName() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java index 8867bdd06bf0..8bda0bd8381d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Model for testing model with \"_class\" property diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java index 25831260e09b..e72113def905 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Client diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java index 89c8b6aba99b..174de6bb5bef 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java @@ -25,6 +25,9 @@ import java.io.IOException; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Dog diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java index b945c2c33db4..dc2f0f751e63 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * DogAllOf diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java index 2512b4cf9d52..0fd2de659e99 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -25,6 +25,9 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * EnumArrays diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java index b9a78241a5a7..ae6366ff6196 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java @@ -16,6 +16,9 @@ import java.util.Objects; import java.util.Arrays; import com.google.gson.annotations.SerializedName; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; import java.io.IOException; import com.google.gson.TypeAdapter; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java index ccbbabaa9ba5..5fa3c853a032 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java @@ -24,6 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.OuterEnum; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * EnumTest @@ -276,6 +279,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired **/ + @NotNull @ApiModelProperty(required = true, value = "") public EnumStringRequiredEnum getEnumStringRequired() { @@ -345,6 +349,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * @return outerEnum **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f4a15cd5b7fd..eb73f8f1e4a6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -25,6 +25,9 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * FileSchemaTestClass @@ -51,6 +54,7 @@ public FileSchemaTestClass file(java.io.File file) { * @return file **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public java.io.File getFile() { @@ -82,6 +86,7 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * @return files **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public List getFiles() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java index 5983420c81b1..c05d5a9485e9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java @@ -28,6 +28,9 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * FormatTest @@ -104,7 +107,7 @@ public FormatTest integer(Integer integer) { * @return integer **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @Min(10) @Max(100) @ApiModelProperty(value = "") public Integer getInteger() { return integer; @@ -129,7 +132,7 @@ public FormatTest int32(Integer int32) { * @return int32 **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @Min(20) @Max(200) @ApiModelProperty(value = "") public Integer getInt32() { return int32; @@ -176,7 +179,9 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number **/ - @ApiModelProperty(required = true, value = "") + @NotNull + @Valid + @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; @@ -201,7 +206,7 @@ public FormatTest _float(Float _float) { * @return _float **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") public Float getFloat() { return _float; @@ -226,7 +231,7 @@ public FormatTest _double(Double _double) { * @return _double **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") public Double getDouble() { return _double; @@ -249,7 +254,7 @@ public FormatTest string(String string) { * @return string **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @Pattern(regexp="/[a-z]/i") @ApiModelProperty(value = "") public String getString() { return string; @@ -271,7 +276,8 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte **/ - @ApiModelProperty(required = true, value = "") + @NotNull + @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; @@ -294,6 +300,7 @@ public FormatTest binary(File binary) { * @return binary **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public File getBinary() { @@ -316,6 +323,8 @@ public FormatTest date(LocalDate date) { * Get date * @return date **/ + @NotNull + @Valid @ApiModelProperty(required = true, value = "") public LocalDate getDate() { @@ -339,6 +348,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * @return dateTime **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { @@ -362,6 +372,7 @@ public FormatTest uuid(UUID uuid) { * @return uuid **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") public UUID getUuid() { @@ -384,7 +395,8 @@ public FormatTest password(String password) { * Get password * @return password **/ - @ApiModelProperty(required = true, value = "") + @NotNull + @Size(min=10,max=64) @ApiModelProperty(required = true, value = "") public String getPassword() { return password; @@ -407,6 +419,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * @return bigDecimal **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public BigDecimal getBigDecimal() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 8fcb26846436..b5f9d033d1fc 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * HasOnlyReadOnly diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java index 7dc68b0ff00f..d2d1452e028a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,6 +26,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * MapTest @@ -115,6 +118,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * @return mapMapOfString **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public Map> getMapMapOfString() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 527853d7522c..ee8f4a7f9bb5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -29,6 +29,9 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * MixedPropertiesAndAdditionalPropertiesClass @@ -59,6 +62,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * @return uuid **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public UUID getUuid() { @@ -82,6 +86,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * @return dateTime **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { @@ -113,6 +118,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public Map getMap() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java index df3683dac78d..55328ed3accd 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Model for testing model name starting with number diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java index b9cf72823b2f..9fb06422b55f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * ModelApiResponse diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java index 6e9714df977d..84afadc74399 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Model for testing reserved words diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java index 94117a9b0f4b..ddea46f4bf1e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Model for testing model name same as property name @@ -57,6 +60,7 @@ public Name name(Integer name) { * Get name * @return name **/ + @NotNull @ApiModelProperty(required = true, value = "") public Integer getName() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java index 9a55d8aa615f..5ea3f679be6f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -24,6 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * NumberOnly @@ -46,6 +49,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * @return justNumber **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public BigDecimal getJustNumber() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java index 4e41a3dc88ea..40eed7b5db9d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java @@ -24,6 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.threeten.bp.OffsetDateTime; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Order @@ -184,6 +187,7 @@ public Order shipDate(OffsetDateTime shipDate) { * @return shipDate **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java index 96b1237f82fa..fef7f5812aa0 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -24,6 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * OuterComposite @@ -54,6 +57,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * @return myNumber **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public BigDecimal getMyNumber() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java index bd870812102c..be690856408e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -16,6 +16,9 @@ import java.util.Objects; import java.util.Arrays; import com.google.gson.annotations.SerializedName; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; import java.io.IOException; import com.google.gson.TypeAdapter; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java index e50743626b47..a20c1cfcdd5e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java @@ -27,6 +27,9 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Pet @@ -141,6 +144,7 @@ public Pet category(Category category) { * @return category **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public Category getCategory() { @@ -163,6 +167,7 @@ public Pet name(String name) { * Get name * @return name **/ + @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { @@ -190,6 +195,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls **/ + @NotNull @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { @@ -221,6 +227,7 @@ public Pet addTagsItem(Tag tagsItem) { * @return tags **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(value = "") public List getTags() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index ed0244a3ca27..d034413519b5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * ReadOnlyFirst diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java index 3405d30ff614..45f9e21f8b63 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * SpecialModelName diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java index 710e0fe54a4e..315b9180f676 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * Tag diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index b6cea1fd768c..bbe170f19845 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -26,6 +26,9 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * TypeHolderDefault @@ -63,6 +66,7 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem **/ + @NotNull @ApiModelProperty(required = true, value = "") public String getStringItem() { @@ -85,6 +89,8 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem **/ + @NotNull + @Valid @ApiModelProperty(required = true, value = "") public BigDecimal getNumberItem() { @@ -107,6 +113,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem **/ + @NotNull @ApiModelProperty(required = true, value = "") public Integer getIntegerItem() { @@ -129,6 +136,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem **/ + @NotNull @ApiModelProperty(required = true, value = "") public Boolean isBoolItem() { @@ -156,6 +164,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem **/ + @NotNull @ApiModelProperty(required = true, value = "") public List getArrayItem() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 787d0123cce9..daa84d59ba9e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -26,6 +26,9 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * TypeHolderExample @@ -67,6 +70,7 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem **/ + @NotNull @ApiModelProperty(example = "what", required = true, value = "") public String getStringItem() { @@ -89,6 +93,8 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem **/ + @NotNull + @Valid @ApiModelProperty(example = "1.234", required = true, value = "") public BigDecimal getNumberItem() { @@ -111,6 +117,7 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem **/ + @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") public Float getFloatItem() { @@ -133,6 +140,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem **/ + @NotNull @ApiModelProperty(example = "-2", required = true, value = "") public Integer getIntegerItem() { @@ -155,6 +163,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem **/ + @NotNull @ApiModelProperty(example = "true", required = true, value = "") public Boolean isBoolItem() { @@ -182,6 +191,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem **/ + @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") public List getArrayItem() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java index d91115317819..760ff3053791 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java @@ -23,6 +23,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * User diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java index 44f00ecc1bd0..d1bae238ba51 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java @@ -26,6 +26,9 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; /** * XmlItem @@ -183,6 +186,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * @return attributeNumber **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getAttributeNumber() { @@ -306,6 +310,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * @return nameNumber **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getNameNumber() { @@ -460,6 +465,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * @return prefixNumber **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getPrefixNumber() { @@ -614,6 +620,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * @return namespaceNumber **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getNamespaceNumber() { @@ -768,6 +775,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * @return prefixNsNumber **/ @javax.annotation.Nullable + @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getPrefixNsNumber() { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java index bd2b2386f2bc..34b1bf258781 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java @@ -732,7 +732,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java index 2c5be6cd0ecb..16ef84563250 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java @@ -852,7 +852,7 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java index 2c5be6cd0ecb..16ef84563250 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java @@ -852,7 +852,7 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java index 1bfe577e26ca..1ce6dc060c27 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java @@ -408,7 +408,7 @@ void testJsonFormData( @PUT("/fake/test-query-paramters") Void testQueryParameterCollectionFormat( - @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SSVParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context ); /** @@ -424,6 +424,6 @@ Void testQueryParameterCollectionFormat( @PUT("/fake/test-query-paramters") void testQueryParameterCollectionFormat( - @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SSVParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context, Callback cb + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java index b1a773c63d71..0c05259fb1e8 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ F.Promise> testJsonFormData( */ @PUT("fake/test-query-paramters") F.Promise> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java index a9c8e3f16da0..f8a5c1f9ec2f 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ CompletionStage> testJsonFormData( */ @PUT("fake/test-query-paramters") CompletionStage> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java index a9c8e3f16da0..f8a5c1f9ec2f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ CompletionStage> testJsonFormData( */ @PUT("fake/test-query-paramters") CompletionStage> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java index dbaa2f6d1b76..d536945d5d43 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -225,7 +225,7 @@ Call testJsonFormData( */ @PUT("fake/test-query-paramters") Call testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java index 438c244adc70..b17c3d20f2b4 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -225,7 +225,7 @@ Observable testJsonFormData( */ @PUT("fake/test-query-paramters") Observable testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java index a2d7e57449e9..82a7657309f2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -226,7 +226,7 @@ Completable testJsonFormData( */ @PUT("fake/test-query-paramters") Completable testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java index 70b3577d960b..e32629442fd5 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -650,7 +650,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i List localVarQueryParams = new ArrayList<>(); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index 46aded06d3f6..186f35269cd7 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -626,7 +626,7 @@ public Mono testQueryParameterCollectionFormat(List pipe, List httpList = OpenAPIUtils.parametersToList("ssv", httpArray); + List httpList = OpenAPIUtils.parametersToList("space", httpArray); List http = new ArrayList(); for (String curParam : httpList) { if (!curParam.isEmpty()) { diff --git a/samples/server/petstore/php-slim4/lib/Model/EnumClass.php b/samples/server/petstore/php-slim4/lib/Model/EnumClass.php index 3ddd829b3137..c3998d8602c5 100644 --- a/samples/server/petstore/php-slim4/lib/Model/EnumClass.php +++ b/samples/server/petstore/php-slim4/lib/Model/EnumClass.php @@ -30,8 +30,8 @@ class EnumClass implements ModelInterface private const MODEL_SCHEMA = <<<'SCHEMA' { "type" : "string", - "default" : "-efg", - "enum" : [ "_abc", "-efg", "(xyz)" ] + "enum" : [ "_abc", "-efg", "(xyz)" ], + "default" : "-efg" } SCHEMA; From ba0387518117429d4f7ba85fd537cd505e6e19c8 Mon Sep 17 00:00:00 2001 From: Esteban Gehring Date: Mon, 27 Apr 2020 16:23:57 +0200 Subject: [PATCH 15/15] re-generate samples --- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 4 +- .../dart2/openapi/lib/api/pet_api.dart | 48 +++++++++---------- .../dart2/openapi/lib/api/store_api.dart | 24 +++++----- .../dart2/openapi/lib/api/user_api.dart | 48 +++++++++---------- .../dart2/openapi/lib/api_client.dart | 22 +++++---- .../go/go-petstore-withXml/api_fake.go | 2 +- .../petstore/go/go-petstore/api_fake.go | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../model/AdditionalPropertiesAnyType.java | 3 -- .../model/AdditionalPropertiesArray.java | 3 -- .../model/AdditionalPropertiesBoolean.java | 3 -- .../model/AdditionalPropertiesClass.java | 11 ----- .../model/AdditionalPropertiesInteger.java | 3 -- .../model/AdditionalPropertiesNumber.java | 3 -- .../model/AdditionalPropertiesObject.java | 3 -- .../model/AdditionalPropertiesString.java | 3 -- .../org/openapitools/client/model/Animal.java | 4 -- .../model/ArrayOfArrayOfNumberOnly.java | 4 -- .../client/model/ArrayOfNumberOnly.java | 4 -- .../openapitools/client/model/ArrayTest.java | 5 -- .../org/openapitools/client/model/BigCat.java | 3 -- .../client/model/BigCatAllOf.java | 3 -- .../client/model/Capitalization.java | 3 -- .../org/openapitools/client/model/Cat.java | 3 -- .../openapitools/client/model/CatAllOf.java | 3 -- .../openapitools/client/model/Category.java | 4 -- .../openapitools/client/model/ClassModel.java | 3 -- .../org/openapitools/client/model/Client.java | 3 -- .../org/openapitools/client/model/Dog.java | 3 -- .../openapitools/client/model/DogAllOf.java | 3 -- .../openapitools/client/model/EnumArrays.java | 3 -- .../openapitools/client/model/EnumClass.java | 3 -- .../openapitools/client/model/EnumTest.java | 5 -- .../client/model/FileSchemaTestClass.java | 5 -- .../openapitools/client/model/FormatTest.java | 29 ++++------- .../client/model/HasOnlyReadOnly.java | 3 -- .../openapitools/client/model/MapTest.java | 4 -- ...ropertiesAndAdditionalPropertiesClass.java | 6 --- .../client/model/Model200Response.java | 3 -- .../client/model/ModelApiResponse.java | 3 -- .../client/model/ModelReturn.java | 3 -- .../org/openapitools/client/model/Name.java | 4 -- .../openapitools/client/model/NumberOnly.java | 4 -- .../org/openapitools/client/model/Order.java | 4 -- .../client/model/OuterComposite.java | 4 -- .../openapitools/client/model/OuterEnum.java | 3 -- .../org/openapitools/client/model/Pet.java | 7 --- .../client/model/ReadOnlyFirst.java | 3 -- .../client/model/SpecialModelName.java | 3 -- .../org/openapitools/client/model/Tag.java | 3 -- .../client/model/TypeHolderDefault.java | 9 ---- .../client/model/TypeHolderExample.java | 10 ---- .../org/openapitools/client/model/User.java | 3 -- .../openapitools/client/model/XmlItem.java | 8 ---- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 4 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../openapitools/client/api/FakeApiImpl.java | 2 +- .../org/openapitools/client/api/FakeApi.java | 2 +- .../javascript-es6/src/api/FakeApi.js | 2 +- .../javascript-promise-es6/src/api/FakeApi.js | 2 +- .../javascript-promise/src/api/FakeApi.js | 2 +- .../petstore/javascript/src/api/FakeApi.js | 2 +- .../petstore_api/api/fake_api.py | 2 +- .../petstore_api/api/fake_api.py | 2 +- .../python/petstore_api/api/fake_api.py | 2 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_api.rb | 2 +- .../python/petstore_api/api/fake_api.py | 2 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_api.rb | 2 +- .../app/controllers/FakeApiController.java | 2 +- .../php-slim4/lib/Model/EnumClass.php | 4 +- 90 files changed, 126 insertions(+), 318 deletions(-) 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 a4ab49f4424d..02a246e64f9c 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 @@ -2697,7 +2697,7 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); } if (url != null) { @@ -2795,7 +2795,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); } if (url != 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 a4ab49f4424d..02a246e64f9c 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 @@ -2697,7 +2697,7 @@ public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionF } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); } if (url != null) { @@ -2795,7 +2795,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync } if (http != null) { - localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index e7f144292bb9..df35324cc5cd 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -2949,7 +2949,7 @@ public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List< if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter @@ -3038,7 +3038,7 @@ public async System.Threading.Tasks.Task> TestQueryParameter if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter - if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "http", http)); // query parameter if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter diff --git a/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart index 2b00c7d63b73..a413df7b4242 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart @@ -28,10 +28,10 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -46,7 +46,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -86,10 +86,10 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -104,7 +104,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -144,10 +144,10 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -162,7 +162,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -203,10 +203,10 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -221,7 +221,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -261,10 +261,10 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["api_key"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -279,7 +279,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -319,10 +319,10 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -337,7 +337,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -376,10 +376,10 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if (name != null) { @@ -406,7 +406,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -445,10 +445,10 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if (additionalMetadata != null) { @@ -474,7 +474,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } diff --git a/samples/client/petstore/dart2/openapi/lib/api/store_api.dart b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart index 3b48cbbc4a3b..10dc4a35b85a 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart @@ -28,10 +28,10 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -46,7 +46,7 @@ class StoreApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -82,10 +82,10 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["api_key"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -100,7 +100,7 @@ class StoreApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -141,10 +141,10 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -159,7 +159,7 @@ class StoreApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -199,10 +199,10 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -217,7 +217,7 @@ class StoreApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } diff --git a/samples/client/petstore/dart2/openapi/lib/api/user_api.dart b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart index 5a35ba394c08..a940ca410713 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart @@ -28,10 +28,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -46,7 +46,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -85,10 +85,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -103,7 +103,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -142,10 +142,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -160,7 +160,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -199,10 +199,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -217,7 +217,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -256,10 +256,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -274,7 +274,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -319,10 +319,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -337,7 +337,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -374,10 +374,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -392,7 +392,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -434,10 +434,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -452,7 +452,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } diff --git a/samples/client/petstore/dart2/openapi/lib/api_client.dart b/samples/client/petstore/dart2/openapi/lib/api_client.dart index 793ac6a73410..d68c9691879f 100644 --- a/samples/client/petstore/dart2/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart2/openapi/lib/api_client.dart @@ -100,7 +100,7 @@ class ApiClient { Object body, Map headerParams, Map formParams, - String contentType, + String nullableContentType, List authNames) async { _updateParamsForAuth(authNames, queryParams, headerParams); @@ -116,7 +116,10 @@ class ApiClient { String url = basePath + path + queryString; headerParams.addAll(_defaultHeaderMap); - headerParams['Content-Type'] = contentType; + if (nullableContentType != null) { + final contentType = nullableContentType; + headerParams['Content-Type'] = contentType; + } if(body is MultipartRequest) { var request = MultipartRequest(method, Uri.parse(url)); @@ -127,20 +130,21 @@ class ApiClient { var response = await client.send(request); return Response.fromStream(response); } else { - var msgBody = contentType == "application/x-www-form-urlencoded" ? formParams : serialize(body); + var msgBody = nullableContentType == "application/x-www-form-urlencoded" ? formParams : serialize(body); + final nullableHeaderParams = (headerParams.isEmpty)? null: headerParams; switch(method) { case "POST": - return client.post(url, headers: headerParams, body: msgBody); + return client.post(url, headers: nullableHeaderParams, body: msgBody); case "PUT": - return client.put(url, headers: headerParams, body: msgBody); + return client.put(url, headers: nullableHeaderParams, body: msgBody); case "DELETE": - return client.delete(url, headers: headerParams); + return client.delete(url, headers: nullableHeaderParams); case "PATCH": - return client.patch(url, headers: headerParams, body: msgBody); + return client.patch(url, headers: nullableHeaderParams, body: msgBody); case "HEAD": - return client.head(url, headers: headerParams); + return client.head(url, headers: nullableHeaderParams); default: - return client.get(url, headers: headerParams); + return client.get(url, headers: nullableHeaderParams); } } } 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 5d60b36436c9..2c5f9b2149b1 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -1170,7 +1170,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("http", parameterToString(http, "ssv")) localVarQueryParams.Add("url", parameterToString(url, "csv")) { t:=context diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index ac3402fe4e4a..5978577ddff1 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -1169,7 +1169,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("http", parameterToString(http, "ssv")) localVarQueryParams.Add("url", parameterToString(url, "csv")) { t:=context diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java index 69cc2a9064f6..7648f4c650fa 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java @@ -407,7 +407,7 @@ public TestQueryParameterCollectionFormatQueryParams ioutil(final List v return this; } public TestQueryParameterCollectionFormatQueryParams http(final List value) { - put("http", EncodingUtils.encodeCollection(value, "space")); + put("http", EncodingUtils.encodeCollection(value, "ssv")); return this; } public TestQueryParameterCollectionFormatQueryParams url(final List value) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java index 69cc2a9064f6..7648f4c650fa 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java @@ -407,7 +407,7 @@ public TestQueryParameterCollectionFormatQueryParams ioutil(final List v return this; } public TestQueryParameterCollectionFormatQueryParams http(final List value) { - put("http", EncodingUtils.encodeCollection(value, "space")); + put("http", EncodingUtils.encodeCollection(value, "ssv")); return this; } public TestQueryParameterCollectionFormatQueryParams url(final List value) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java index ea1d42bae884..3c3ca7c4c9c9 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java @@ -760,7 +760,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java index 6410a95d1731..506535e1d33e 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1149,7 +1149,7 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List testQueryParameterCollectionFormatWithHttpInfo(List testQueryParameterCollectionFormatWithHttpInfo(List pipe, List i List localVarQueryParams = new ArrayList<>(); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(ApiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("ssv", "http", http)); localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 121867dd07a9..657e2dfd968b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1791,7 +1791,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } if (http != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 121867dd07a9..657e2dfd968b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1791,7 +1791,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, Li } if (http != null) { - localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http)); } if (url != null) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index aba19948f055..79c169543fde 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesAnyType diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index bb35b0970ef4..e16ee861f893 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -26,9 +26,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesArray diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b3528f7a8722..29161b52aa16 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesBoolean diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 9b270abdb56e..a067b01ec979 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -27,9 +27,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesClass @@ -131,7 +128,6 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * @return mapNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Map getMapNumber() { @@ -225,7 +221,6 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { @@ -257,7 +252,6 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List * @return mapArrayAnytype **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Map> getMapArrayAnytype() { @@ -289,7 +283,6 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { @@ -321,7 +314,6 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { @@ -345,7 +337,6 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { * @return anytype1 **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Object getAnytype1() { @@ -369,7 +360,6 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { * @return anytype2 **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Object getAnytype2() { @@ -393,7 +383,6 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { * @return anytype3 **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Object getAnytype3() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 574b6ad8f1bb..3a15ed7cd977 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesInteger diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index c138d835e55a..9bc46e099916 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -26,9 +26,6 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesNumber diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 48bd74a65a60..bd65f7791c5e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesObject diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8be8dcd782d6..cdb8afedaaf4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * AdditionalPropertiesString diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java index 4cbc678b5321..cea2ff5988d7 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Animal @@ -55,7 +52,6 @@ public Animal className(String className) { * Get className * @return className **/ - @NotNull @ApiModelProperty(required = true, value = "") public String getClassName() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 9db163e71534..a6dd760660d5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -26,9 +26,6 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * ArrayOfArrayOfNumberOnly @@ -59,7 +56,6 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr * @return arrayArrayNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public List> getArrayArrayNumber() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 02106b473bc8..487c539d3bac 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -26,9 +26,6 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * ArrayOfNumberOnly @@ -59,7 +56,6 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * @return arrayNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public List getArrayNumber() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java index 4ec8e611d8c6..7d66ce233feb 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -26,9 +26,6 @@ import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * ArrayTest @@ -98,7 +95,6 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * @return arrayArrayOfInteger **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { @@ -130,7 +126,6 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * @return arrayArrayOfModel **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java index 14436bf9f98a..74b7ddc8135b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java @@ -25,9 +25,6 @@ import java.io.IOException; import org.openapitools.client.model.BigCatAllOf; import org.openapitools.client.model.Cat; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * BigCat diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java index eaa296451029..cd2207704bd1 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * BigCatAllOf diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java index 90db42f19630..d4fbec81c543 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Capitalization diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java index 1d89f2afd131..e5a45ef03d89 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java @@ -25,9 +25,6 @@ import java.io.IOException; import org.openapitools.client.model.Animal; import org.openapitools.client.model.CatAllOf; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Cat diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java index 6061abfee808..3299c8ea8776 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * CatAllOf diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java index 1837174952ac..4d07c3a1bef1 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Category @@ -74,7 +71,6 @@ public Category name(String name) { * Get name * @return name **/ - @NotNull @ApiModelProperty(required = true, value = "") public String getName() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java index 8bda0bd8381d..8867bdd06bf0 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Model for testing model with \"_class\" property diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java index e72113def905..25831260e09b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Client diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java index 174de6bb5bef..89c8b6aba99b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java @@ -25,9 +25,6 @@ import java.io.IOException; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Dog diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java index dc2f0f751e63..b945c2c33db4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * DogAllOf diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java index 0fd2de659e99..2512b4cf9d52 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * EnumArrays diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java index ae6366ff6196..b9a78241a5a7 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumClass.java @@ -16,9 +16,6 @@ import java.util.Objects; import java.util.Arrays; import com.google.gson.annotations.SerializedName; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; import java.io.IOException; import com.google.gson.TypeAdapter; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java index 5fa3c853a032..ccbbabaa9ba5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java @@ -24,9 +24,6 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.openapitools.client.model.OuterEnum; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * EnumTest @@ -279,7 +276,6 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired **/ - @NotNull @ApiModelProperty(required = true, value = "") public EnumStringRequiredEnum getEnumStringRequired() { @@ -349,7 +345,6 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * @return outerEnum **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index eb73f8f1e4a6..f4a15cd5b7fd 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -25,9 +25,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * FileSchemaTestClass @@ -54,7 +51,6 @@ public FileSchemaTestClass file(java.io.File file) { * @return file **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public java.io.File getFile() { @@ -86,7 +82,6 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * @return files **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public List getFiles() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java index c05d5a9485e9..5983420c81b1 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java @@ -28,9 +28,6 @@ import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * FormatTest @@ -107,7 +104,7 @@ public FormatTest integer(Integer integer) { * @return integer **/ @javax.annotation.Nullable - @Min(10) @Max(100) @ApiModelProperty(value = "") + @ApiModelProperty(value = "") public Integer getInteger() { return integer; @@ -132,7 +129,7 @@ public FormatTest int32(Integer int32) { * @return int32 **/ @javax.annotation.Nullable - @Min(20) @Max(200) @ApiModelProperty(value = "") + @ApiModelProperty(value = "") public Integer getInt32() { return int32; @@ -179,9 +176,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number **/ - @NotNull - @Valid - @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; @@ -206,7 +201,7 @@ public FormatTest _float(Float _float) { * @return _float **/ @javax.annotation.Nullable - @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + @ApiModelProperty(value = "") public Float getFloat() { return _float; @@ -231,7 +226,7 @@ public FormatTest _double(Double _double) { * @return _double **/ @javax.annotation.Nullable - @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + @ApiModelProperty(value = "") public Double getDouble() { return _double; @@ -254,7 +249,7 @@ public FormatTest string(String string) { * @return string **/ @javax.annotation.Nullable - @Pattern(regexp="/[a-z]/i") @ApiModelProperty(value = "") + @ApiModelProperty(value = "") public String getString() { return string; @@ -276,8 +271,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte **/ - @NotNull - @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @ApiModelProperty(required = true, value = "") + @ApiModelProperty(required = true, value = "") public byte[] getByte() { return _byte; @@ -300,7 +294,6 @@ public FormatTest binary(File binary) { * @return binary **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public File getBinary() { @@ -323,8 +316,6 @@ public FormatTest date(LocalDate date) { * Get date * @return date **/ - @NotNull - @Valid @ApiModelProperty(required = true, value = "") public LocalDate getDate() { @@ -348,7 +339,6 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * @return dateTime **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { @@ -372,7 +362,6 @@ public FormatTest uuid(UUID uuid) { * @return uuid **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") public UUID getUuid() { @@ -395,8 +384,7 @@ public FormatTest password(String password) { * Get password * @return password **/ - @NotNull - @Size(min=10,max=64) @ApiModelProperty(required = true, value = "") + @ApiModelProperty(required = true, value = "") public String getPassword() { return password; @@ -419,7 +407,6 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * @return bigDecimal **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public BigDecimal getBigDecimal() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index b5f9d033d1fc..8fcb26846436 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * HasOnlyReadOnly diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java index d2d1452e028a..7dc68b0ff00f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java @@ -26,9 +26,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * MapTest @@ -118,7 +115,6 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * @return mapMapOfString **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Map> getMapMapOfString() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ee8f4a7f9bb5..527853d7522c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -29,9 +29,6 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * MixedPropertiesAndAdditionalPropertiesClass @@ -62,7 +59,6 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * @return uuid **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public UUID getUuid() { @@ -86,7 +82,6 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * @return dateTime **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { @@ -118,7 +113,6 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Map getMap() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java index 55328ed3accd..df3683dac78d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Model for testing model name starting with number diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 9fb06422b55f..b9cf72823b2f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * ModelApiResponse diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java index 84afadc74399..6e9714df977d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Model for testing reserved words diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java index ddea46f4bf1e..94117a9b0f4b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Model for testing model name same as property name @@ -60,7 +57,6 @@ public Name name(Integer name) { * Get name * @return name **/ - @NotNull @ApiModelProperty(required = true, value = "") public Integer getName() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java index 5ea3f679be6f..9a55d8aa615f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -24,9 +24,6 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * NumberOnly @@ -49,7 +46,6 @@ public NumberOnly justNumber(BigDecimal justNumber) { * @return justNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public BigDecimal getJustNumber() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java index 40eed7b5db9d..4e41a3dc88ea 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java @@ -24,9 +24,6 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import org.threeten.bp.OffsetDateTime; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Order @@ -187,7 +184,6 @@ public Order shipDate(OffsetDateTime shipDate) { * @return shipDate **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java index fef7f5812aa0..96b1237f82fa 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -24,9 +24,6 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.math.BigDecimal; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * OuterComposite @@ -57,7 +54,6 @@ public OuterComposite myNumber(BigDecimal myNumber) { * @return myNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public BigDecimal getMyNumber() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java index be690856408e..bd870812102c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -16,9 +16,6 @@ import java.util.Objects; import java.util.Arrays; import com.google.gson.annotations.SerializedName; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; import java.io.IOException; import com.google.gson.TypeAdapter; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java index a20c1cfcdd5e..e50743626b47 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java @@ -27,9 +27,6 @@ import java.util.List; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Pet @@ -144,7 +141,6 @@ public Pet category(Category category) { * @return category **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public Category getCategory() { @@ -167,7 +163,6 @@ public Pet name(String name) { * Get name * @return name **/ - @NotNull @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { @@ -195,7 +190,6 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls **/ - @NotNull @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { @@ -227,7 +221,6 @@ public Pet addTagsItem(Tag tagsItem) { * @return tags **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(value = "") public List getTags() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index d034413519b5..ed0244a3ca27 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * ReadOnlyFirst diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java index 45f9e21f8b63..3405d30ff614 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * SpecialModelName diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java index 315b9180f676..710e0fe54a4e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * Tag diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index bbe170f19845..b6cea1fd768c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -26,9 +26,6 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * TypeHolderDefault @@ -66,7 +63,6 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem **/ - @NotNull @ApiModelProperty(required = true, value = "") public String getStringItem() { @@ -89,8 +85,6 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem **/ - @NotNull - @Valid @ApiModelProperty(required = true, value = "") public BigDecimal getNumberItem() { @@ -113,7 +107,6 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem **/ - @NotNull @ApiModelProperty(required = true, value = "") public Integer getIntegerItem() { @@ -136,7 +129,6 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem **/ - @NotNull @ApiModelProperty(required = true, value = "") public Boolean isBoolItem() { @@ -164,7 +156,6 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem **/ - @NotNull @ApiModelProperty(required = true, value = "") public List getArrayItem() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java index daa84d59ba9e..787d0123cce9 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -26,9 +26,6 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * TypeHolderExample @@ -70,7 +67,6 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem **/ - @NotNull @ApiModelProperty(example = "what", required = true, value = "") public String getStringItem() { @@ -93,8 +89,6 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem **/ - @NotNull - @Valid @ApiModelProperty(example = "1.234", required = true, value = "") public BigDecimal getNumberItem() { @@ -117,7 +111,6 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem **/ - @NotNull @ApiModelProperty(example = "1.234", required = true, value = "") public Float getFloatItem() { @@ -140,7 +133,6 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem **/ - @NotNull @ApiModelProperty(example = "-2", required = true, value = "") public Integer getIntegerItem() { @@ -163,7 +155,6 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem **/ - @NotNull @ApiModelProperty(example = "true", required = true, value = "") public Boolean isBoolItem() { @@ -191,7 +182,6 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem **/ - @NotNull @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") public List getArrayItem() { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java index 760ff3053791..d91115317819 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java @@ -23,9 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * User diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java index d1bae238ba51..44f00ecc1bd0 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java @@ -26,9 +26,6 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; -import org.hibernate.validator.constraints.*; /** * XmlItem @@ -186,7 +183,6 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * @return attributeNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getAttributeNumber() { @@ -310,7 +306,6 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * @return nameNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getNameNumber() { @@ -465,7 +460,6 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * @return prefixNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getPrefixNumber() { @@ -620,7 +614,6 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * @return namespaceNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getNamespaceNumber() { @@ -775,7 +768,6 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * @return prefixNsNumber **/ @javax.annotation.Nullable - @Valid @ApiModelProperty(example = "1.234", value = "") public BigDecimal getPrefixNsNumber() { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java index 34b1bf258781..bd2b2386f2bc 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java @@ -732,7 +732,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java index 16ef84563250..2c5be6cd0ecb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java @@ -852,7 +852,7 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java index 16ef84563250..2c5be6cd0ecb 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java @@ -852,7 +852,7 @@ public ResponseEntity testQueryParameterCollectionFormatWithHttpInfo(List< queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("ssv".toUpperCase(Locale.ROOT)), "http", http)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java index 1ce6dc060c27..1bfe577e26ca 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java @@ -408,7 +408,7 @@ void testJsonFormData( @PUT("/fake/test-query-paramters") Void testQueryParameterCollectionFormat( - @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SSVParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context ); /** @@ -424,6 +424,6 @@ Void testQueryParameterCollectionFormat( @PUT("/fake/test-query-paramters") void testQueryParameterCollectionFormat( - @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context, Callback cb + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SSVParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context, Callback cb ); } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java index 0c05259fb1e8..b1a773c63d71 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ F.Promise> testJsonFormData( */ @PUT("fake/test-query-paramters") F.Promise> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java index f8a5c1f9ec2f..a9c8e3f16da0 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ CompletionStage> testJsonFormData( */ @PUT("fake/test-query-paramters") CompletionStage> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java index f8a5c1f9ec2f..a9c8e3f16da0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java @@ -230,7 +230,7 @@ CompletionStage> testJsonFormData( */ @PUT("fake/test-query-paramters") CompletionStage> testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java index d536945d5d43..dbaa2f6d1b76 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -225,7 +225,7 @@ Call testJsonFormData( */ @PUT("fake/test-query-paramters") Call testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java index b17c3d20f2b4..438c244adc70 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -225,7 +225,7 @@ Observable testJsonFormData( */ @PUT("fake/test-query-paramters") Observable testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java index 82a7657309f2..a2d7e57449e9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -226,7 +226,7 @@ Completable testJsonFormData( */ @PUT("fake/test-query-paramters") Completable testQueryParameterCollectionFormat( - @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context ); } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java index e32629442fd5..70b3577d960b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -650,7 +650,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i List localVarQueryParams = new ArrayList<>(); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("ssv", "http", http)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index 186f35269cd7..46aded06d3f6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -626,7 +626,7 @@ public Mono testQueryParameterCollectionFormat(List pipe, List httpList = OpenAPIUtils.parametersToList("space", httpArray); + List httpList = OpenAPIUtils.parametersToList("ssv", httpArray); List http = new ArrayList(); for (String curParam : httpList) { if (!curParam.isEmpty()) { diff --git a/samples/server/petstore/php-slim4/lib/Model/EnumClass.php b/samples/server/petstore/php-slim4/lib/Model/EnumClass.php index c3998d8602c5..3ddd829b3137 100644 --- a/samples/server/petstore/php-slim4/lib/Model/EnumClass.php +++ b/samples/server/petstore/php-slim4/lib/Model/EnumClass.php @@ -30,8 +30,8 @@ class EnumClass implements ModelInterface private const MODEL_SCHEMA = <<<'SCHEMA' { "type" : "string", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] } SCHEMA;